fix(perf): prevent Canvas double-mount on /site redirect

HomePage used to mount the Canvas before its effect fired the redirect
to /site, then unmount it as soon as the route changed. That left the
WebGL context torn down mid-load with GLTF requests still in flight,
which on slow GPUs ended in a 'Context Lost' and a stuck 1 FPS render
once the user came back from /site. The fix is a synchronous cookie
check after all hooks: if the user has not visited /site today we
return null and let the redirect happen without ever creating a GL
context.

Also drops the GameMap 'lite map skipped' log from warn to info: it
is an expected lite-loading path, not a problem worth a yellow warning.
This commit is contained in:
Tom Boullay
2026-05-30 19:51:57 +02:00
parent 82dc47a296
commit 0fa7a82175
2 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ export function GameMap({
sceneData.mapNodes.length - visibleMapNodes.length;
if (skippedMapNodeCount > 0) {
logger.warn("GameMap", "Lite map skipped heavy map nodes", {
logger.info("GameMap", "Lite map skipped heavy map nodes", {
skippedMapNodeCount,
});
}