- 통합 핸들러 appBack.handleBack 추출: 오버레이 닫기 → 화면 뒤로 → 최상위에서 '한 번 더 누르면 종료' 토스트(네이티브) - 하단 내비 뒤로 버튼이 옛 로직(홈에서 무반응)이라 하드웨어 뒤로와 동작이 달랐던 문제 해결 — 둘이 같은 핸들러 사용 - capacitor.js 중복 로직 제거 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { handleBack } from '@/composables/appBack'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -9,9 +10,8 @@ const isHome = computed(() => route.path === '/')
|
||||
const isSettings = computed(() => route.path.startsWith('/settings'))
|
||||
|
||||
function goBack() {
|
||||
// 히스토리가 있으면 뒤로, 없으면 홈으로 (앱 첫 화면에서 빠져나가지 않게)
|
||||
if (window.history.length > 1) router.back()
|
||||
else router.push('/')
|
||||
// 하드웨어 뒤로가기와 동일 동작(오버레이 닫기 → 화면 뒤로 → 최상위 종료 안내)
|
||||
handleBack(router)
|
||||
}
|
||||
function goForward() {
|
||||
router.forward()
|
||||
|
||||
Reference in New Issue
Block a user