stop the ws connection from retrying when logging out or session is expired

This commit is contained in:
sadnub
2021-07-20 16:46:16 -04:00
parent bfa5b4fba5
commit c943f6f936

View File

@@ -567,7 +567,7 @@ export default {
};
this.ws.onclose = e => {
console.log(`Closed code: ${e.code}`);
if (e.code !== 1000) {
if (e.code !== 1000 && this.ws) {
setTimeout(() => {
this.setupWS();
}, 2 * 1000);
@@ -901,6 +901,7 @@ export default {
},
beforeUnmount() {
this.ws.close();
this.ws = null;
clearInterval(this.poll);
},
};