filter unwanted fields from received JSON board string

This commit is contained in:
Jesse D. McDonald 2020-03-30 00:06:19 -05:00
parent d37cb4a67f
commit ce7a69a10a
1 changed files with 2 additions and 1 deletions

View File

@ -478,7 +478,8 @@ $(function (){
cancelGameCallback = gun.get(PacoSakoUUID).get('games').get(newId).onWithCancel(function(d) { cancelGameCallback = gun.get(PacoSakoUUID).get('games').get(newId).onWithCancel(function(d) {
if (d && d.board) { if (d && d.board) {
try { try {
const moves = JSON.parse(d.board); const received = JSON.parse(d.board);
const moves = { past: [...received.past], future: [...received.future] };
const oldState = { past: currentGame.moves, future: currentGame.redoMoves }; const oldState = { past: currentGame.moves, future: currentGame.redoMoves };
if (deepEqual(moves, oldState)) { if (deepEqual(moves, oldState)) {