From 1ce491a70c3818839bbdabb996106c13168eff42 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 11 Feb 2025 13:03:06 +0100 Subject: [PATCH] fix(sync): try to reconnect after network error when getting token --- umap/static/umap/js/modules/sync/engine.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/modules/sync/engine.js b/umap/static/umap/js/modules/sync/engine.js index 62106352..640ae5f4 100644 --- a/umap/static/umap/js/modules/sync/engine.js +++ b/umap/static/umap/js/modules/sync/engine.js @@ -71,9 +71,11 @@ export class SyncEngine { }) const [response, _, error] = await this._umap.server.get(websocketTokenURI) - if (!error) { - this.start(response.token) + if (error) { + this.reconnect() + return } + this.start(response.token) } start(authToken) {