FIX - return to the primary home page

This commit is contained in:
Type
2026-08-08 18:58:16 +02:00
parent 897aab9ebb
commit e3119af5b2
2 changed files with 14 additions and 4 deletions
+5 -1
View File
@@ -115,6 +115,7 @@ type CalendarReminderData = {
const REFERENCE_VIEWPORT_WIDTH = 1920
const REFERENCE_VIEWPORT_HEIGHT = 1080
const PHONE_BASE_SCALE = 0.69
const DEVELOPMENT_PHONE_SCALE = 1.25
const isDevelopment = import.meta.env.DEV
const phone = usePhoneStore()
@@ -144,7 +145,10 @@ const controlCenterOpened = ref(false)
const simPicker = ref<SimPickerPayload | null>(null)
const systemColorScheme = window.matchMedia('(prefers-color-scheme: dark)')
const viewportScale = ref(getViewportScale())
const phoneBaseZoom = computed(() => viewportScale.value * PHONE_BASE_SCALE)
const phoneBaseZoom = computed(() =>
viewportScale.value *
(isDevelopment ? DEVELOPMENT_PHONE_SCALE : PHONE_BASE_SCALE),
)
const phoneResolutionStyle = computed<CSSProperties>(() => ({
'--phone-edge-gap': `${24 * viewportScale.value}px`,
'--phone-stack-gap': `${16 * viewportScale.value}px`,
@@ -6,17 +6,23 @@ import { usePhoneStore } from '@/stores/phone'
const route = useRoute()
const router = useRouter()
const phone = usePhoneStore()
const isApp = computed(() => route.name === 'app')
const HOME_PAGE = 1
const canGoHome = computed(
() => route.name !== 'home' || phone.currentPage !== HOME_PAGE,
)
function goHome(): void {
if (isApp.value) void router.push('/')
if (!canGoHome.value) return
phone.setCurrentPage(HOME_PAGE)
if (route.name !== 'home') void router.push('/')
}
</script>
<template>
<button
class="phone-home-indicator"
:class="{ 'phone-home-indicator--interactive': isApp }"
:class="{ 'phone-home-indicator--interactive': canGoHome }"
type="button"
:aria-label="phone.t('Common.home')"
@pointerdown.stop="goHome"