Implement Smart Location: auto-detect user location if preference is enabled, hide location button, and handle permission denial by resetting preference
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
|
||||
<!-- Version info -->
|
||||
<div class="version-info">
|
||||
<p class="app-subtitle">Transporte Público Boquete</p>
|
||||
<p class="app-subtitle">{{ t('splash.subtitle') }}</p>
|
||||
<p class="app-version">Versión 2.0.1</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -29,15 +29,17 @@ import { useRouter } from 'vue-router'
|
||||
import { useRouteStore } from '@/stores/route'
|
||||
import { useBusStopStore } from '@/stores/busStop'
|
||||
import { supabase } from '@/supabase'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const router = useRouter()
|
||||
const { t } = useI18n()
|
||||
const routeStore = useRouteStore()
|
||||
const busStopStore = useBusStopStore()
|
||||
|
||||
const logoVisible = ref(false)
|
||||
const showLoading = ref(false)
|
||||
const loadingVisible = ref(false)
|
||||
const statusMessage = ref('Iniciando SIBU...')
|
||||
const statusMessage = ref(t('splash.starting'))
|
||||
|
||||
onMounted(async () => {
|
||||
logoVisible.value = true
|
||||
@ -47,7 +49,7 @@ onMounted(async () => {
|
||||
// Timeout logic
|
||||
const initTimeout = setTimeout(() => {
|
||||
console.warn('Initialization taking too long, forcing navigation...')
|
||||
statusMessage.value = 'Iniciando modo sin conexión...'
|
||||
statusMessage.value = t('splash.offline')
|
||||
router.replace('/map')
|
||||
}, 4000)
|
||||
|
||||
@ -93,7 +95,7 @@ async function navigate(sessionData?: any, force = false) {
|
||||
}
|
||||
|
||||
async function performInitializationTasks() {
|
||||
statusMessage.value = 'Verificando datos...'
|
||||
statusMessage.value = t('splash.verifying')
|
||||
console.log('Starting initialization tasks...')
|
||||
|
||||
// Load essential map data in parallel to save time
|
||||
@ -108,7 +110,7 @@ async function performInitializationTasks() {
|
||||
console.error('Error pre-loading map data', e)
|
||||
}
|
||||
|
||||
statusMessage.value = 'Listo para usar'
|
||||
statusMessage.value = t('splash.ready')
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user