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