summaryrefslogtreecommitdiffstats
path: root/web/play/src/main.ts
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-08 03:34:38 +0100
committersalmonik <salmonik@tuta.io>2026-11-08 03:34:38 +0100
commit408fac5c545c4294c81df5fff36b2fed19d7fe55 (patch)
treeef5a05d8099a1531f88cd3e5008225ea47910fc4 /web/play/src/main.ts
parentweb: accept the serialized reels array and stop game loops on navigation (diff)
downloadzagan-bet-408fac5c545c4294c81df5fff36b2fed19d7fe55.tar.gz
zagan-bet-408fac5c545c4294c81df5fff36b2fed19d7fe55.zip
web: restore the balance on a refresh into history
The gateway hello now carries the core's last known balance alongside the user, so a refresh on a non-game view does not blank the header before the next INFO reply.
Diffstat (limited to 'web/play/src/main.ts')
-rw-r--r--web/play/src/main.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/web/play/src/main.ts b/web/play/src/main.ts
index f051429..2dd3ce9 100644
--- a/web/play/src/main.ts
+++ b/web/play/src/main.ts
@@ -68,6 +68,7 @@ const gateway = new Gateway(wsUrl, {
68 onHello(hello) { 68 onHello(hello) {
69 serverOffset = hello.time - Date.now(); 69 serverOffset = hello.time - Date.now();
70 currentUser = hello.user ?? null; 70 currentUser = hello.user ?? null;
71 if (typeof hello.balance === "number") lastBalance = hello.balance;
71 gameBadge.textContent = `v${hello.version}`; 72 gameBadge.textContent = `v${hello.version}`;
72 }, 73 },
73 onView(next) { 74 onView(next) {