Fix player name update
authorBenjamin Auder <benjamin.auder@somewhere>
Sat, 4 Apr 2020 17:31:30 +0000 (19:31 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Sat, 4 Apr 2020 17:31:30 +0000 (19:31 +0200)
client/src/utils/gameStorage.js

index 42f4388..fe7335e 100644 (file)
@@ -89,7 +89,7 @@ export const GameStorage = {
             else if (k == "chat") game.chats.push(obj[k]);
             else if (k == "chatRead") game.chatRead = Date.now();
             else if (k == "delchat") game.chats = [];
-            else if (k == "playerName") game.players[obj.idx] = obj.name;
+            else if (k == "playerName") game.players[obj[k].idx] = obj[k].name;
             else game[k] = obj[k];
           });
           objectStore.put(game); //save updated data