mirror of
https://github.com/DerTyp7/teamspeak-obs-overlay.git
synced 2025-10-29 21:02:10 +01:00
[refactor] add setTimeout before reconnect
This commit is contained in:
@@ -30,6 +30,7 @@ export class TS5Connection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reconnect() {
|
reconnect() {
|
||||||
|
console.log("Reconnecting...")
|
||||||
this.ws.close();
|
this.ws.close();
|
||||||
|
|
||||||
this.ws = new WebSocket(`ws://localhost:${this.remoteAppPort}`);
|
this.ws = new WebSocket(`ws://localhost:${this.remoteAppPort}`);
|
||||||
@@ -74,7 +75,9 @@ export class TS5Connection {
|
|||||||
localStorage.removeItem("apiKey");
|
localStorage.removeItem("apiKey");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.reconnect();
|
setTimeout(() => {
|
||||||
|
this.reconnect();
|
||||||
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Handle messages received from TS5 client
|
// Handle messages received from TS5 client
|
||||||
|
|||||||
Reference in New Issue
Block a user