fix reconnection spamming

This commit is contained in:
2023-11-25 11:12:31 +01:00
parent 3025781a04
commit 01a278eda2
5 changed files with 58 additions and 13 deletions

View File

@@ -155,12 +155,20 @@ createApp( {
setTimeout( () => {
if ( !self.isReconnecting ) {
self.isReconnecting = true;
self.connect();
self.isReconnecting = false;
self.tryReconnect();
}
}, 1000 );
}, false );
},
tryReconnect() {
const int = setInterval( () => {
if ( !this.isReconnecting ) {
clearInterval( int );
} else {
connectToSSESource();
}
}, 1000 );
},
handleBackground() {
let colourDetails = [];
let colours = [];