projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve games/challenges display and fix MyGames page reactivity (using () for now...)
[vchess.git]
/
client
/
src
/
views
/
Game.vue
diff --git
a/client/src/views/Game.vue
b/client/src/views/Game.vue
index
18a2836
..
e7db972
100644
(file)
--- a/
client/src/views/Game.vue
+++ b/
client/src/views/Game.vue
@@
-7,7
+7,13
@@
main
)
.card.text-center
label.modal-close(for="modalInfo")
)
.card.text-center
label.modal-close(for="modalInfo")
- p(v-html="infoMessage")
+ p
+ span {{ st.tr["Rematch in progress:"] }}
+ a(
+ :href="'#/game/' + rematchId"
+ onClick="document.getElementById('modalInfo').checked=false"
+ )
+ | {{ "#/game/" + rematchId }}
input#modalChat.modal(
type="checkbox"
@click="resetChatColor()"
input#modalChat.modal(
type="checkbox"
@click="resetChatColor()"
@@
-161,7
+167,7
@@
export default {
virtualClocks: [],
vr: null, //"variant rules" object initialized from FEN
drawOffer: "",
virtualClocks: [],
vr: null, //"variant rules" object initialized from FEN
drawOffer: "",
-
infoMessage
: "",
+
rematchId
: "",
rematchOffer: "",
lastateAsked: false,
people: {}, //players + observers
rematchOffer: "",
lastateAsked: false,
people: {}, //players + observers
@@
-701,14
+707,7
@@
export default {
});
urlRid += onlineSid[Math.floor(Math.random() * onlineSid.length)];
}
});
urlRid += onlineSid[Math.floor(Math.random() * onlineSid.length)];
}
- this.infoMessage =
- this.st.tr["Rematch in progress:"] +
- " <a href='#/game/" +
- gameInfo.id + urlRid +
- "'>" +
- "#/game/" +
- gameInfo.id + urlRid +
- "</a>";
+ this.rematchId = gameInfo.id + urlRid;
document.getElementById("modalInfo").checked = true;
}
break;
document.getElementById("modalInfo").checked = true;
}
break;
@@
-833,7
+832,7
@@
export default {
if (!err) {
if (this.st.settings.sound)
new Audio("/sounds/newgame.flac").play().catch(() => {});
if (!err) {
if (this.st.settings.sound)
new Audio("/sounds/newgame.flac").play().catch(() => {});
- callback();
+
if (!!callback)
callback();
this.$router.push("/game/" + gameInfo.id);
}
});
this.$router.push("/game/" + gameInfo.id);
}
});
@@
-938,14
+937,9
@@
export default {
if (game.score == "*") {
// Set clocks + initime
game.initime = [0, 0];
if (game.score == "*") {
// Set clocks + initime
game.initime = [0, 0];
- if (L >= 1) {
- const gameLastupdate = game.moves[L-1].played;
- game.initime[L % 2] = gameLastupdate;
- if (L >= 2) {
- game.clocks[L % 2] =
- tc.mainTime - (Date.now() - gameLastupdate) / 1000;
- }
- }
+ if (L >= 1) game.initime[L % 2] = game.moves[L-1].played;
+ // NOTE: game.clocks shouldn't be computed right now:
+ // job will be done in re_setClocks() called soon below.
}
// Sort chat messages from newest to oldest
game.chats.sort((c1, c2) => {
}
// Sort chat messages from newest to oldest
game.chats.sort((c1, c2) => {