summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-02-11 01:01:04 +0100
committerTor Andersson <tor@ccxvii.net>2025-02-12 12:04:43 +0100
commita764abe6565544bea8591b26839ad931f3f42e4d (patch)
treeb085b01746fb339a55e06c2423cdb90bf674581c /public
parent61e0d18ed045ed89ba9abd711fe7b1b5be2ec095 (diff)
downloadserver-a764abe6565544bea8591b26839ad931f3f42e4d.tar.gz
Use state.active to detect finished games.
Instead of looking for (state.state === "game_over"). Add is_active_role helper function.
Diffstat (limited to 'public')
-rw-r--r--public/common/client.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/public/common/client.js b/public/common/client.js
index a11f712..288f479 100644
--- a/public/common/client.js
+++ b/public/common/client.js
@@ -361,9 +361,9 @@ function toggle_notepad() {
show_notepad()
}
-/* REMATCH & REPLAY BUTTONS WHEN GAME OVER */
+/* REMATCH & REPLAY BUTTONS WHEN GAME IS FINISHED */
-function on_game_over() {
+function on_finished() {
remove_resign_menu()
add_icon_button(1, "replay_button", "sherlock-holmes-mirror",
@@ -547,8 +547,10 @@ function connect_play() {
if (typeof on_update === "function")
on_update()
on_update_log(view.log_start, game_log.length)
- if (view.game_over)
- on_game_over()
+ break
+
+ case "finished":
+ on_finished()
break
case "snapsize":