From 638a789a0fe8b73567b0de31987e6ad6ec985be4 Mon Sep 17 00:00:00 2001 From: George Powell Date: Wed, 18 Feb 2026 14:48:02 -0500 Subject: [PATCH] device always replaces local localStorage completion with the authoritative DB record --- src/routes/+page.svelte | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 397ecd8..abb2039 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -186,14 +186,15 @@ }); }); - // For logged-in users on a new device: restore today's game state from the server + // For logged-in users on a new device: restore today's game state from the server. + // Runs even when isWon is true so that logging in after completing the game on another + // device always replaces local localStorage with the authoritative DB record. let crossDeviceCheckDate = $state(null); $effect(() => { if ( !browser || !user || !dailyVerse?.date || - isWon || crossDeviceCheckDate === dailyVerse.date || !persistence.anonymousId ) @@ -415,6 +416,18 @@ {/if} + + {#if user && session} +
+ Signed in as {[user.firstName, user.lastName].filter(Boolean).join(" ")}{user.email ? ` (${user.email})` : ""}{user.appleId ? " using Apple" : ""} +
+ +
+
+ {/if}