X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Futils%2FgameStorage.js;fp=client%2Fsrc%2Futils%2FgameStorage.js;h=480c73baef65a958676481b72ded2afd7c29a204;hb=57eb158fe8e37daaae11685df846003cda4aba19;hp=2e78994286cbb19cdb795b8ca6880e6b04cd92f5;hpb=5db58b8012d88285a0cb7b513e59469504b5676e;p=vchess.git diff --git a/client/src/utils/gameStorage.js b/client/src/utils/gameStorage.js index 2e789942..480c73ba 100644 --- a/client/src/utils/gameStorage.js +++ b/client/src/utils/gameStorage.js @@ -84,6 +84,8 @@ export const GameStorage = { // Ignoring error silently: shouldn't happen now. TODO? if (event.target.result) { let game = event.target.result; + // Hidden tabs are delayed, to prevent multi-updates: + if (obj.moveIdx < game.moves.length) return; Object.keys(obj).forEach(k => { if (k == "move") game.moves.push(obj[k]); else game[k] = obj[k];