perf: eager preconnections and map loading to cut initial boot by 3s
This commit is contained in:
@ -14,6 +14,7 @@ import { useTaxiStore } from './stores/taxi'
|
||||
import { useShuttleStore } from './stores/shuttle'
|
||||
import { useCouponStore } from './stores/coupon'
|
||||
import { supabase } from '@/supabase'
|
||||
import { useGoogleMaps } from '@/composables/useGoogleMaps'
|
||||
// useFavoritesStore ya importado arriba (línea 8)
|
||||
|
||||
// Initialize theme store
|
||||
@ -22,6 +23,10 @@ const { locale } = useI18n()
|
||||
const themeStore = useThemeStore()
|
||||
const authStore = useAuthStore()
|
||||
const favoritesStore = useFavoritesStore()
|
||||
const { loadMaps } = useGoogleMaps()
|
||||
|
||||
// Iniciar descarga asíncrona masiva de Google Maps al bootear VUE (Ahorra ~3 seg de espera en MapView)
|
||||
loadMaps()
|
||||
|
||||
const isSplashScreen = computed(() => route.name === 'splash')
|
||||
const isAuthScreen = computed(() => {
|
||||
|
||||
@ -221,7 +221,6 @@ function handleVisibilityChange() {
|
||||
|
||||
async function initializeMap() {
|
||||
await nextTick();
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
|
||||
initMap("map", mapStore.center, mapStore.zoom);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user