mirror of
https://github.com/chuot/rdio-scanner.git
synced 2026-08-13 16:33:01 -06:00
Always reconnect websocket
This commit is contained in:
parent
045bafdf00
commit
79bdf7b3e7
|
|
@ -722,10 +722,20 @@ export class AppRdioScannerService implements OnDestroy {
|
|||
this.webSocket.close();
|
||||
|
||||
this.webSocket = undefined;
|
||||
|
||||
clearTimeout(this.webSocketTimeout);
|
||||
clearInterval(this.webSocketInterval);
|
||||
}
|
||||
|
||||
if (this.webSocketTimeout) {
|
||||
clearTimeout(this.webSocketTimeout);
|
||||
|
||||
this.webSocketTimeout = undefined;
|
||||
}
|
||||
|
||||
if (this.webSocketInterval) {
|
||||
clearInterval(this.webSocketInterval);
|
||||
|
||||
this.webSocketInterval = undefined;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private webSocketKeepAlive(): void {
|
||||
|
|
@ -751,11 +761,7 @@ export class AppRdioScannerService implements OnDestroy {
|
|||
|
||||
this.webSocket = new WebSocket(webSocketUrl);
|
||||
|
||||
this.webSocket.onclose = (ev: CloseEvent) => {
|
||||
if (ev.code !== 1000) {
|
||||
this.webSocketReconnect();
|
||||
}
|
||||
};
|
||||
this.webSocket.onclose = () => this.webSocketReconnect();
|
||||
|
||||
this.webSocket.onerror = () => { };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue