From: Benjamin Auder Date: Wed, 18 Mar 2020 07:23:26 +0000 (+0100) Subject: Fix message when resigning X-Git-Url: https://git.auder.net/variants/current/doc/css/img/pieces/cq.svg?a=commitdiff_plain;h=059228c9fd737361dc97de69811daed5abbd6254;p=vchess.git Fix message when resigning --- 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"