perf: reduce background return latency via session caching and async map rendering
This commit is contained in:
@ -48,9 +48,9 @@ export const useRouteStore = defineStore('route', () => {
|
||||
// Si estamos en background, podemos sobreescribir la carga sin mostrar spinner
|
||||
if (isLoadingRoutes.value && !isBackground) return;
|
||||
|
||||
// Si no forzamos, no hay filtros raros, ya tenemos rutas y aún no expira el caché, omitir llamada
|
||||
// Excepción: isBackground de refocus obliga a actualizar para asegurar frescura después de mucho rato apagado.
|
||||
if (!force && !isBackground && !filters && allRoutes.value.length > 0 && (now - lastFetched.value < CACHE_TIME)) {
|
||||
// Si no forzamos, no hay filtros raros, ya tenemos rutas y aún no expira el caché, omitir llamada.
|
||||
// Se respeta en background también porque descargar docenas de rutas traba el Javascript en móviles.
|
||||
if (!force && !filters && allRoutes.value.length > 0 && (now - lastFetched.value < CACHE_TIME)) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user