fix: resolve blank screen on return from external links

This commit is contained in:
2026-03-03 20:51:17 -05:00
parent 7ff205b12a
commit af7464be43
7 changed files with 108 additions and 18 deletions

View File

@ -26,12 +26,25 @@ export const useShuttleStore = defineStore('shuttle', () => {
}
}
// Recarga silenciosa: no activa el spinner (para refocus desde background)
async function silentReload() {
if (shuttles.value.length === 0) { return loadShuttles() }
error.value = null
try {
shuttles.value = await shuttlesService.getAllShuttles(filters.value)
} catch (e) {
console.error('Error silent-reloading shuttles:', e)
// No mostrar error si ya hay datos
}
}
return {
shuttles,
isLoading,
error,
filters,
loadShuttles,
silentReload,
}
}, {
persist: {

View File

@ -31,6 +31,18 @@ export const useTaxiStore = defineStore('taxi', () => {
loadTaxis()
}
// Recarga silenciosa: no activa el spinner (para refocus desde background)
async function silentReload() {
if (taxis.value.length === 0) { return loadTaxis() }
error.value = null
try {
taxis.value = await taxisService.getAllTaxis(filters.value)
} catch (e) {
console.error('Error silent-reloading taxis:', e)
// No mostrar error si ya hay datos
}
}
return {
taxis,
isLoading,
@ -38,6 +50,7 @@ export const useTaxiStore = defineStore('taxi', () => {
filters,
loadTaxis,
setFilters,
silentReload,
}
}, {
persist: {