From e24bc938c17559fec986de24be15bc3c5966f499 Mon Sep 17 00:00:00 2001 From: Adrian Gruntkowski Date: Sat, 7 Dec 2024 19:54:01 +0100 Subject: [PATCH] Fix synced store in offline mode operation --- priv/static/js/jenot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/priv/static/js/jenot.js b/priv/static/js/jenot.js index c3f3e38..3dcb5a5 100644 --- a/priv/static/js/jenot.js +++ b/priv/static/js/jenot.js @@ -19,7 +19,8 @@ const isLoggedIn = !!document.cookie // Notes storage configuration. // The storage is a combination of IndexedDB + network sync. // Network sync is only enabled is user is logged in. -const Notes = new SyncedNoteStore("jenot-app", "notes", isLoggedIn && "/"); +const endpoint = isLoggedIn ? "/" : null; +const Notes = new SyncedNoteStore("jenot-app", "notes", endpoint); // Reset metadata to force full sync if (URL_PARAMS.has("reset-meta")) {