From 059228c9fd737361dc97de69811daed5abbd6254 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Wed, 18 Mar 2020 08:23:26 +0100
Subject: [PATCH] Fix message when resigning

---
 client/src/views/Game.vue | 8 ++++----
 server/models/User.js     | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue
index caf8dd8e..5785abdd 100644
--- a/client/src/views/Game.vue
+++ b/client/src/views/Game.vue
@@ -663,8 +663,8 @@ export default {
           break;
         }
         case "resign":
-          const score = data.side == "b" ? "1-0" : "0-1";
-          const side = data.side == "w" ? "White" : "Black";
+          const score = (data.data == "b" ? "1-0" : "0-1");
+          const side = (data.data == "w" ? "White" : "Black");
           this.gameOver(score, side + " surrender");
           break;
         case "abort":
@@ -904,8 +904,8 @@ export default {
       if (!this.game.mycolor || !confirm(this.st.tr["Resign the game?"]))
         return;
       this.send("resign", { data: this.game.mycolor });
-      const score = this.game.mycolor == "w" ? "0-1" : "1-0";
-      const side = this.game.mycolor == "w" ? "White" : "Black";
+      const score = (this.game.mycolor == "w" ? "0-1" : "1-0");
+      const side = (this.game.mycolor == "w" ? "White" : "Black");
       this.gameOver(score, side + " surrender");
     },
     // 3 cases for loading a game:
diff --git a/server/models/User.js b/server/models/User.js
index 0ff8e1c8..e3e5408c 100644
--- a/server/models/User.js
+++ b/server/models/User.js
@@ -149,7 +149,7 @@ const UserModel = {
           // Remove users unlogged for > 24h
           if (!u.sessionToken && tsNow - u.created > day)
           {
-            notify(
+            UserModel.notify(
               u,
               "Your account has been deleted because " +
               "you didn't log in for 24h after registration"
-- 
2.44.0