fix for not notifying on next move after switching game
This commit is contained in:
parent
327d7a74bc
commit
a1a9eea758
|
|
@ -1276,6 +1276,12 @@ $(function (){
|
||||||
function notifyLocalMove(game, gameId) {
|
function notifyLocalMove(game, gameId) {
|
||||||
if (!game) {
|
if (!game) {
|
||||||
delete lastNotifyState[gameId];
|
delete lastNotifyState[gameId];
|
||||||
|
|
||||||
|
/* Preload the last-known state if we already have data for this game */
|
||||||
|
const localMeta = IO.getCachedMeta();
|
||||||
|
if (gameId in localMeta) {
|
||||||
|
notifyForGame(localMeta[gameId], gameId);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
lastNotifyState[gameId] = lastNotifyState[gameId] || {};
|
lastNotifyState[gameId] = lastNotifyState[gameId] || {};
|
||||||
lastNotifyState[gameId].moves = game.moves;
|
lastNotifyState[gameId].moves = game.moves;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue