Increment game stat counter also for rematch live games
authorBenjamin Auder <benjamin.auder@somewhere>
Thu, 21 Jan 2021 18:26:29 +0000 (19:26 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Thu, 21 Jan 2021 18:26:29 +0000 (19:26 +0100)
client/src/views/Game.vue

index 1eef334..c2b2704 100644 (file)
@@ -1064,8 +1064,15 @@ export default {
           // Also to MyGames page:
           this.notifyMyGames("newgame", gameInfo);
         };
-        if (this.game.type == "live")
+        if (this.game.type == "live") {
+          // Increment game stats counter in DB
+          ajax(
+            "/gamestat",
+            "POST",
+            { data: { vid: gameInfo.vid } }
+          );
           this.addAndGotoLiveGame(gameInfo, notifyNewGame);
+        }
         else {
           // corr game
           ajax(