projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Checkless and trackKingWrap()
[xogo.git]
/
app.js
diff --git
a/app.js
b/app.js
index
1090b30
..
c5d5c7f
100644
(file)
--- a/
app.js
+++ b/
app.js
@@
-373,7
+373,7
@@
const messageCenter = (msg) => {
if (document.hidden)
notifyMe("move");
vr.playReceivedMove(obj.moves, () => {
if (document.hidden)
notifyMe("move");
vr.playReceivedMove(obj.moves, () => {
- if (vr.getCurrentScore(obj.moves
[obj.moves.length-1]
) != "*") {
+ if (vr.getCurrentScore(obj.moves) != "*") {
localStorage.removeItem("gid");
setTimeout( () => toggleVisible("gameStopped"), 2000 );
}
localStorage.removeItem("gid");
setTimeout( () => toggleVisible("gameStopped"), 2000 );
}
@@
-390,6
+390,10
@@
const messageCenter = (msg) => {
case "closerematch":
toggleVisible("newGame");
break;
case "closerematch":
toggleVisible("newGame");
break;
+ case "filechange":
+ // TODO?: could be more subtle
+ setTimeout(() => location.reload(), 100);
+ break;
}
};
}
};
@@
-470,7
+474,6
@@
const afterPlay = (move_s, newTurn, ops) => {
{gid: gid, moves: curMoves, fen: vr.getFen()},
{
retry: true,
{gid: gid, moves: curMoves, fen: vr.getFen()},
{
retry: true,
- success: () => curMoves = [],
error: () => alert("Move not sent: reload page")
}
);
error: () => alert("Move not sent: reload page")
}
);
@@
-478,7
+481,8
@@
const afterPlay = (move_s, newTurn, ops) => {
}
if (ops.res && newTurn != playerColor) {
toggleTurnIndicator(false); //now all moves are sent and animated
}
if (ops.res && newTurn != playerColor) {
toggleTurnIndicator(false); //now all moves are sent and animated
- const result = vr.getCurrentScore(move_s);
+ const result = vr.getCurrentScore(curMoves);
+ curMoves = [];
if (result != "*") {
setTimeout(() => {
toggleVisible("gameStopped");
if (result != "*") {
setTimeout(() => {
toggleVisible("gameStopped");