prevent notification for incomplete moves
This commit is contained in:
parent
f4340312fd
commit
223fd6490a
|
|
@ -573,12 +573,14 @@ 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']) {
|
||||||
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