summaryrefslogtreecommitdiffstats
path: root/web/play/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'web/play/src/main.ts')
-rw-r--r--web/play/src/main.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/play/src/main.ts b/web/play/src/main.ts
index fd55250..f051429 100644
--- a/web/play/src/main.ts
+++ b/web/play/src/main.ts
@@ -1,10 +1,10 @@
1import { byId, money, node, sha256Hex, toast, toneFor } from "./dom"; 1import { byId, money, node, sha256Hex, toast, toneFor } from "./dom";
2import { Gateway } from "./net"; 2import { Gateway } from "./net";
3import { renderBlackjack } from "./blackjack"; 3import { renderBlackjack } from "./blackjack";
4import { renderCrash } from "./crash"; 4import { renderCrash, stopCrashAnimation } from "./crash";
5import { renderHistory } from "./history"; 5import { renderHistory } from "./history";
6import { renderRoulette } from "./roulette"; 6import { renderRoulette } from "./roulette";
7import { renderSlots } from "./slots"; 7import { renderSlots, stopSlotsAnimation } from "./slots";
8import type { View } from "./types"; 8import type { View } from "./types";
9 9
10const authScreen = byId("auth-screen"); 10const authScreen = byId("auth-screen");
@@ -72,6 +72,8 @@ const gateway = new Gateway(wsUrl, {
72 }, 72 },
73 onView(next) { 73 onView(next) {
74 view = next; 74 view = next;
75 if (next.screen !== "slots") stopSlotsAnimation();
76 if (next.screen !== "crash") stopCrashAnimation();
75 // Game and history views carry no account field; the lobby is the source 77 // Game and history views carry no account field; the lobby is the source
76 // of truth for who is signed in. A null lobby user is a logout or an 78 // of truth for who is signed in. A null lobby user is a logout or an
77 // expired session. 79 // expired session.