fix bug when switching from non-functional account

This commit is contained in:
MathMan05 2024-08-11 15:54:17 -05:00
parent 20b716ae57
commit 85c42f70d2
2 changed files with 6 additions and 1 deletions

View file

@ -118,6 +118,7 @@ class Localuser{
User.clear();
}
async initwebsocket():Promise<void>{
if(!this.initialized) return;
let returny=null
const promise=new Promise((res)=>{returny=res});
this.ws = new WebSocket(this.serverurls.gateway.toString()+"?encoding=json&v=9"+(DecompressionStream?"&compress=zlib-stream":""));
@ -220,8 +221,8 @@ class Localuser{
document.getElementById("load-desc").innerHTML="Unable to connect to the Spacebar server, retrying in <b>" + Math.round(0.2 + (this.errorBackoff*2.8)) + "</b> seconds...";
setTimeout(() => {
if(!this.initialized) return;
document.getElementById("load-desc").textContent="Retrying...";
this.initwebsocket().then(() => {
this.loaduser();
this.init();