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

index fe7335e..99206ed 100644 (file)
@@ -89,7 +89,8 @@ 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[k].idx] = obj[k].name;
+            else if (k == "playerName")
+              game.players[obj[k].idx].name = obj[k].name;
             else game[k] = obj[k];
           });
           objectStore.put(game); //save updated data