Street testing fixes
This commit is contained in:
@@ -164,7 +164,7 @@ class PiPedalSocket {
|
||||
}
|
||||
} catch (error) {
|
||||
if (this.onError) {
|
||||
this.onError("Invalid server response. " + error, error);
|
||||
this.onError("Invalid server response. " + error, error as Error);
|
||||
} else {
|
||||
throw new PiPedalStateError("Invalid server response.");
|
||||
}
|
||||
@@ -189,6 +189,9 @@ class PiPedalSocket {
|
||||
return;
|
||||
|
||||
}
|
||||
this._reconnect();
|
||||
}
|
||||
_reconnect() {
|
||||
this._discardReplyReservations();
|
||||
this.retrying = true;
|
||||
this.retryCount = 0;
|
||||
@@ -199,6 +202,20 @@ class PiPedalSocket {
|
||||
this.reconnect();
|
||||
}
|
||||
|
||||
isBackground: boolean = false;
|
||||
|
||||
enterBackgroundState()
|
||||
{
|
||||
this.isBackground = true;
|
||||
this.socket?.close();
|
||||
|
||||
}
|
||||
exitBackgroundState()
|
||||
{
|
||||
this.isBackground = false;
|
||||
this._reconnect();
|
||||
}
|
||||
|
||||
reconnect() {
|
||||
|
||||
if (this.socket)
|
||||
|
||||
Reference in New Issue
Block a user