Small fix
authorBenjamin Auder <benjamin.auder@somewhere>
Fri, 6 Mar 2020 13:40:53 +0000 (14:40 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Fri, 6 Mar 2020 13:40:53 +0000 (14:40 +0100)
client/src/components/ChallengeList.vue
client/src/views/Game.vue

index 7572ede..5a3db5c 100644 (file)
@@ -37,8 +37,12 @@ export default {
       let augmentedChalls = this.challenges.map(c => {
         let priority = 0;
         if (!!c.to && c.to == this.st.user.name) priority = 1;
       let augmentedChalls = this.challenges.map(c => {
         let priority = 0;
         if (!!c.to && c.to == this.st.user.name) priority = 1;
-        else if (c.from.sid == this.st.user.sid || c.from.id == this.st.user.id)
+        else if (
+          c.from.sid == this.st.user.sid ||
+          (c.from.id > 0 && c.from.id == this.st.user.id)
+        ) {
           priority = 2;
           priority = 2;
+        }
         if (c.added < minAdded) minAdded = c.added;
         if (c.added > maxAdded) maxAdded = c.added;
         return Object.assign({}, c, { priority: priority });
         if (c.added < minAdded) minAdded = c.added;
         if (c.added > maxAdded) maxAdded = c.added;
         return Object.assign({}, c, { priority: priority });
index 9bca38e..edeb18f 100644 (file)
@@ -246,7 +246,7 @@ export default {
     notifyTurn: function(sid) {
       const player = this.people[sid];
       const colorIdx = this.game.players.findIndex(
     notifyTurn: function(sid) {
       const player = this.people[sid];
       const colorIdx = this.game.players.findIndex(
-        p => p.sid == sid || p.id == player.id);
+        p => p.sid == sid || p.uid == player.id);
       const color = ["w","b"][colorIdx];
       const movesCount = this.game.moves.length;
       const yourTurn =
       const color = ["w","b"][colorIdx];
       const movesCount = this.game.moves.length;
       const yourTurn =