projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Attempt to get rid of the weird trans-pages errors (especially in Game)
[vchess.git]
/
client
/
src
/
views
/
Hall.vue
diff --git
a/client/src/views/Hall.vue
b/client/src/views/Hall.vue
index
9bb913c
..
f401c6e
100644
(file)
--- a/
client/src/views/Hall.vue
+++ b/
client/src/views/Hall.vue
@@
-80,6
+80,7
@@
main
option(value="")
option(
v-for="p in Object.values(people)"
option(value="")
option(
v-for="p in Object.values(people)"
+ v-if="!!p.name"
:value="p.name"
)
| {{ p.name }}
:value="p.name"
)
| {{ p.name }}
@@
-266,9
+267,14
@@
export default {
});
if (!this.newchallenge.V && this.newchallenge.vid > 0)
this.loadNewchallVariant();
});
if (!this.newchallenge.V && this.newchallenge.vid > 0)
this.loadNewchallVariant();
+ },
+ $route: function(to, from) {
+ if (to.path != "/") this.cleanBeforeDestroy();
}
},
created: function() {
}
},
created: function() {
+ document.addEventListener('visibilitychange', this.visibilityChange);
+ window.addEventListener("beforeunload", this.cleanBeforeDestroy);
if (this.st.variants.length > 0 && this.newchallenge.vid > 0)
this.loadNewchallVariant();
const my = this.st.user;
if (this.st.variants.length > 0 && this.newchallenge.vid > 0)
this.loadNewchallVariant();
const my = this.st.user;
@@
-303,7
+309,6
@@
export default {
this.conn.addEventListener("close", this.socketCloseListener);
},
mounted: function() {
this.conn.addEventListener("close", this.socketCloseListener);
},
mounted: function() {
- document.addEventListener('visibilitychange', this.visibilityChange);
["peopleWrap", "infoDiv", "newgameDiv"].forEach(eltName => {
document.getElementById(eltName)
.addEventListener("click", processModalClick);
["peopleWrap", "infoDiv", "newgameDiv"].forEach(eltName => {
document.getElementById(eltName)
.addEventListener("click", processModalClick);
@@
-387,10
+392,14
@@
export default {
);
},
beforeDestroy: function() {
);
},
beforeDestroy: function() {
- document.removeEventListener('visibilitychange', this.visibilityChange);
- this.send("disconnect");
+ this.cleanBeforeDestroy();
},
methods: {
},
methods: {
+ cleanBeforeDestroy: function() {
+ document.removeEventListener('visibilitychange', this.visibilityChange);
+ window.removeEventListener("beforeunload", this.cleanBeforeDestroy);
+ this.send("disconnect");
+ },
getRandomnessClass: function(pc) {
return {
["random-" + pc.randomness]: true
getRandomnessClass: function(pc) {
return {
["random-" + pc.randomness]: true