Crash on initial load.

Fixes #20
This commit is contained in:
Robin Davies
2022-03-10 11:22:42 -05:00
parent 3737afb52b
commit 0319cc0588
7 changed files with 97 additions and 22 deletions
+7 -1
View File
@@ -178,6 +178,9 @@ class PiPedalSocket {
throw new PiPedalStateError("Server connection lost.");
}
}
canReconnect: boolean = false;
handleClose(_event: any): any {
if (this.retrying) {
// treat this as a fatal error.
@@ -189,7 +192,10 @@ class PiPedalSocket {
return;
}
this._reconnect();
if (this.canReconnect)
{
this._reconnect();
}
}
_reconnect() {
this._discardReplyReservations();