X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FMyGames.vue;h=94035287c16807b30a3ad7ca6e66886ee90e01f1;hb=d54f6261c9e30f4eabb402ad301dd5c5e40fb656;hp=7615308b730bc721ae73c543146279d441a5fbcd;hpb=68e3aa8c7a92efe3461bfc5c904f9763bca5d2da;p=vchess.git diff --git a/client/src/views/MyGames.vue b/client/src/views/MyGames.vue index 7615308b..94035287 100644 --- a/client/src/views/MyGames.vue +++ b/client/src/views/MyGames.vue @@ -53,7 +53,7 @@ export default { corr: Number.MAX_SAFE_INTEGER }, // hasMore == TRUE: a priori there could be more games to load - hasMore: { live: true, corr: true }, + hasMore: { live: true, corr: store.state.user.id > 0 }, conn: null, connexionString: "" }; @@ -68,12 +68,9 @@ export default { // Initialize connection this.connexionString = params.socketUrl + - "/?sid=" + - this.st.user.sid + - "&id=" + - this.st.user.id + - "&tmpId=" + - getRandString() + + "/?sid=" + this.st.user.sid + + "&id=" + this.st.user.id + + "&tmpId=" + getRandString() + "&page=" + encodeURIComponent(this.$route.path); this.conn = new WebSocket(this.connexionString); @@ -129,12 +126,7 @@ export default { } } ); - } else { - this.loadMore( - "live", - () => this.loadMore("corr", adjustAndSetDisplay) - ); - } + } else this.loadMore("live", adjustAndSetDisplay); }); }, beforeDestroy: function() { @@ -297,7 +289,7 @@ export default { } }, loadMore: function(type, cb) { - if (type == "corr") { + if (type == "corr" && this.st.user.id > 0) { ajax( "/completedgames", "GET",