Fix synced store in offline mode operation

This commit is contained in:
Adrian Gruntkowski 2024-12-07 19:54:01 +01:00
parent fac118aadf
commit e24bc938c1

View file

@ -19,7 +19,8 @@ const isLoggedIn = !!document.cookie
// Notes storage configuration. // Notes storage configuration.
// The storage is a combination of IndexedDB + network sync. // The storage is a combination of IndexedDB + network sync.
// Network sync is only enabled is user is logged in. // 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 // Reset metadata to force full sync
if (URL_PARAMS.has("reset-meta")) { if (URL_PARAMS.has("reset-meta")) {