diff options
Diffstat (limited to '')
| -rw-r--r-- | web/play/src/main.ts | 1 | ||||
| -rw-r--r-- | web/play/src/types.ts | 2 |
2 files changed, 3 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) { |
diff --git a/web/play/src/types.ts b/web/play/src/types.ts index e594a0b..ae2c4c7 100644 --- a/web/play/src/types.ts +++ b/web/play/src/types.ts | |||
| @@ -9,6 +9,8 @@ export type Hello = { | |||
| 9 | grace_seconds: number; | 9 | grace_seconds: number; |
| 10 | /** Signed-in user restored after a refresh, if any. */ | 10 | /** Signed-in user restored after a refresh, if any. */ |
| 11 | user?: string | null; | 11 | user?: string | null; |
| 12 | /** Last known balance, for views that do not carry one. */ | ||
| 13 | balance?: number | null; | ||
| 12 | /** Estimated game-server Unix time in milliseconds. */ | 14 | /** Estimated game-server Unix time in milliseconds. */ |
| 13 | time: number; | 15 | time: number; |
| 14 | }; | 16 | }; |
