From f522a98defbe9467f7424930d509abc3fc7c408a Mon Sep 17 00:00:00 2001 From: emnet-4 Date: Wed, 7 Jan 2026 06:04:28 -0500 Subject: [PATCH] Fixed immediate score updates and auto-sorting by score --- server.py | 2 +- static/scoreboard.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 372a266c..c480b3cf 100644 --- a/server.py +++ b/server.py @@ -50,7 +50,7 @@ def increase_score(): for team in scoreboard: if team["id"] == team_id: team["score"] += 1 - + scoreboard.sort(key=lambda x: x["score"], reverse=True) return jsonify(scoreboard=scoreboard) diff --git a/static/scoreboard.js b/static/scoreboard.js index 34ce2009..46fd669a 100644 --- a/static/scoreboard.js +++ b/static/scoreboard.js @@ -32,7 +32,7 @@ function increase_score(id){ contentType: "application/json; charset=utf-8", data : JSON.stringify(team_id), success: function(result){ - + display_scoreboard(result.scoreboard); }, error: function(request, status, error){ console.log("Error");