fix: resolve blank screen on return from external links
This commit is contained in:
@ -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: {
|
||||
|
||||
@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user