mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 02:22:44 +01:00
fix(v2): skip view transition on query-only nav; slow reachability poll
- router: a `?tab=` change (same path) no longer runs a view transition, which was snapshotting the GameDetails cover's `view-transition-name` into the top layer over the fixed navbar. - useServerConnection: raise the online `/heartbeat` poll from 10s to 5min so a network blip stops aggressively flagging the backend offline; passive interceptor events still flip offline instantly, and the offline poll stays fast for quick recovery. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -659,7 +659,13 @@ router.beforeEach(async (to, _from, next) => {
|
||||
}
|
||||
});
|
||||
|
||||
router.beforeResolve(async () => {
|
||||
router.beforeResolve(async (to, from) => {
|
||||
// Query/hash-only changes (same path — e.g. the v2 GameDetails `?tab=`
|
||||
// param) aren't a real view change. Running a view transition would
|
||||
// snapshot every `view-transition-name` element (like the details cover)
|
||||
// into the browser's top layer for the crossfade, briefly floating it over
|
||||
// the fixed navbar. Skip them — matching `scrollBehavior` above.
|
||||
if (to.path === from.path) return;
|
||||
const viewTransition = startViewTransition();
|
||||
await viewTransition.captured;
|
||||
});
|
||||
|
||||
@@ -20,7 +20,11 @@ import { debounce } from "lodash";
|
||||
import { computed, effectScope, watch } from "vue";
|
||||
import storeHeartbeat from "@/stores/heartbeat";
|
||||
|
||||
const POLL_ONLINE_MS = 10_000;
|
||||
// While online, probe only occasionally — a network blip shouldn't rush to
|
||||
// flag the backend as down. Passive interceptor events still flip us offline
|
||||
// the instant a real request fails, so this slow poll is just a safety net.
|
||||
const POLL_ONLINE_MS = 5 * 60_000;
|
||||
// Once offline, poll quickly so recovery is picked up promptly.
|
||||
const POLL_OFFLINE_MS = 5_000;
|
||||
const HEARTBEAT_TIMEOUT_MS = 5_000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user