fix reconnecting issues
This commit is contained in:
@@ -117,6 +117,7 @@ class Localuser{
|
||||
SnowFlake.clear();
|
||||
User.clear();
|
||||
}
|
||||
swapped=false;
|
||||
async initwebsocket():Promise<void>{
|
||||
let returny=null
|
||||
const promise=new Promise((res)=>{returny=res});
|
||||
@@ -221,7 +222,7 @@ 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;
|
||||
if(this.swapped) return;
|
||||
document.getElementById("load-desc").textContent="Retrying...";
|
||||
this.initwebsocket().then(() => {
|
||||
this.loaduser();
|
||||
|
Reference in New Issue
Block a user