diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-08 03:34:38 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-08 03:34:38 +0100 |
| commit | 408fac5c545c4294c81df5fff36b2fed19d7fe55 (patch) | |
| tree | ef5a05d8099a1531f88cd3e5008225ea47910fc4 /webd | |
| parent | web: accept the serialized reels array and stop game loops on navigation (diff) | |
| download | zagan-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 '')
| -rw-r--r-- | webd/src/session.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/webd/src/session.rs b/webd/src/session.rs index 3b34f47..7389028 100644 --- a/webd/src/session.rs +++ b/webd/src/session.rs | |||
| @@ -187,6 +187,8 @@ enum ServerMessage<'a> { | |||
| 187 | grace_seconds: u64, | 187 | grace_seconds: u64, |
| 188 | /// Signed-in user, so a refresh during a game can skip the login card. | 188 | /// Signed-in user, so a refresh during a game can skip the login card. |
| 189 | user: Option<&'a str>, | 189 | user: Option<&'a str>, |
| 190 | /// Last known balance, for views that do not carry one. | ||
| 191 | balance: Option<i64>, | ||
| 190 | /// Estimated game-server Unix time, milliseconds. | 192 | /// Estimated game-server Unix time, milliseconds. |
| 191 | time: u64, | 193 | time: u64, |
| 192 | }, | 194 | }, |
| @@ -258,6 +260,7 @@ impl Session { | |||
| 258 | version: VERSION, | 260 | version: VERSION, |
| 259 | grace_seconds: self.config.grace.as_secs(), | 261 | grace_seconds: self.config.grace.as_secs(), |
| 260 | user: self.core.user(), | 262 | user: self.core.user(), |
| 263 | balance: self.core.balance(), | ||
| 261 | time: self.core.server_now_ms(), | 264 | time: self.core.server_now_ms(), |
| 262 | }, | 265 | }, |
| 263 | ); | 266 | ); |
