projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Coregal variant + simplify time management in Game.vue
[vchess.git]
/
client
/
src
/
views
/
Hall.vue
diff --git
a/client/src/views/Hall.vue
b/client/src/views/Hall.vue
index
4d830bb
..
d0cabb4
100644
(file)
--- a/
client/src/views/Hall.vue
+++ b/
client/src/views/Hall.vue
@@
-296,8
+296,8
@@
export default {
encodeURIComponent(this.$route.path);
this.conn = new WebSocket(this.connexionString);
this.conn.onopen = connectAndPoll;
encodeURIComponent(this.$route.path);
this.conn = new WebSocket(this.connexionString);
this.conn.onopen = connectAndPoll;
- this.conn.
onmessage = this.socketMessageListener
;
- this.conn.
onclose = this.socketCloseListener
;
+ this.conn.
addEventListener("message", this.socketMessageListener)
;
+ this.conn.
addEventListener("close", this.socketCloseListener)
;
},
mounted: function() {
document.addEventListener('visibilitychange', this.visibilityChange);
},
mounted: function() {
document.addEventListener('visibilitychange', this.visibilityChange);
@@
-653,6
+653,8
@@
export default {
break;
case "killed":
// I logged in elsewhere:
break;
case "killed":
// I logged in elsewhere:
+ this.conn.removeEventListener("message", this.socketMessageListener);
+ this.conn.removeEventListener("close", this.socketCloseListener);
this.conn = null;
alert(this.st.tr["New connexion detected: tab now offline"]);
break;
this.conn = null;
alert(this.st.tr["New connexion detected: tab now offline"]);
break;
@@
-1190,7
+1192,6
@@
export default {
// Game state (including FEN): will be updated
moves: [],
clocks: [-1, -1], //-1 = unstarted
// Game state (including FEN): will be updated
moves: [],
clocks: [-1, -1], //-1 = unstarted
- initime: [0, 0], //initialized later
score: "*"
}
);
score: "*"
}
);