fix for notifying after undo/redo
This commit is contained in:
parent
223fd6490a
commit
bde8eee5ad
|
|
@ -573,15 +573,16 @@ function switchGameId(newId){
|
||||||
const board = JSON.parse(d['board']);
|
const board = JSON.parse(d['board']);
|
||||||
const cb_board = $('#cb_board').first();
|
const cb_board = $('#cb_board').first();
|
||||||
if ($('#cb_notify')[0].checked && cb_board.data('skip_notify') !== d['board']) {
|
if ($('#cb_notify')[0].checked && cb_board.data('skip_notify') !== d['board']) {
|
||||||
if (!board['phantom']) {
|
/* ignore partial moves and undo/redo */
|
||||||
|
if (!board['phantom'] && !board['subsequent']) {
|
||||||
if (board['move'] && board['move']['took'] === 'k') {
|
if (board['move'] && board['move']['took'] === 'k') {
|
||||||
notify((board['move']['side'][0] === 'd' ? 'Dark' : 'Light') + ' player won!');
|
notify((board['move']['side'][0] === 'd' ? 'Dark' : 'Light') + ' player won!');
|
||||||
} else {
|
} else {
|
||||||
notify((board['player'][0] === 'd' ? 'Dark' : 'Light') + ' player\'s turn');
|
notify((board['player'][0] === 'd' ? 'Dark' : 'Light') + ' player\'s turn');
|
||||||
}
|
}
|
||||||
|
$('#cb_board').data('skip_notify', d['board']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$('#cb_board').data('skip_notify', d['board']);
|
|
||||||
$('#cb_board').data('board', board);
|
$('#cb_board').data('board', board);
|
||||||
renderBoard(board);
|
renderBoard(board);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue