Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: make sure connection is disconnected before reconnecting

thecodrre0d2cbc0198e
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index e7f2f3671..df8a17eda 100644
--- a/packages/core/api/sync/index.js
+++ b/packages/core/api/sync/index.js
@@ -387,7 +387,11 @@ class Sync {
}
async checkConnection() {
- if (this.connection.state !== signalr.HubConnectionState.Connected)
+ if (this.connection.state !== signalr.HubConnectionState.Connected) {
+ if (this.connection.state !== signalr.HubConnectionState.Disconnected)
+ await this.connection.stop();
+
await this.connection.start();
+ }
}
}