mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-21 22:31:46 +00:00
fix: resolve splash hang, dashboard skeleton, and sync-stuck regressions
- TripPlannerPage: change splash effect dep from `trip` (object ref) to `trip?.id` (primitive) — background refreshes no longer reset the 1500 ms timer on every new object reference, fixing the forever-splash on SPA nav - tripRepo.list: await upserts on the cold-IDB path so the next mount reads from Dexie instead of hitting the network again, fixing the remount skeleton - tripSyncManager: add stale-flag detection (>2 min resets _syncing), 90 s hard timeout via Promise.race, parallel post-sync prefetch via Promise.allSettled, and updated header comment to reflect manual-only policy - OfflineTab: guard handleResync with a 120 s client-side timeout that interrupts and clears the spinner if syncAll stalls
This commit is contained in:
@@ -36,7 +36,11 @@ export const tripRepo = {
|
||||
|
||||
const fresh = await refresh
|
||||
if (!fresh) return { trips: [], archivedTrips: [], refresh: Promise.resolve(null) }
|
||||
// Data came straight from network — no background re-fetch needed
|
||||
// Await upserts on cold path so next mount reads from IDB instead of hitting network again
|
||||
await Promise.all([
|
||||
...fresh.trips.map(t => upsertTrip(t)),
|
||||
...fresh.archivedTrips.map(t => upsertTrip(t)),
|
||||
]).catch(() => {})
|
||||
return { ...fresh, refresh: Promise.resolve(null) }
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user