dexie-cloud-addon 4.3.8 → 4.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ==========================================================================
10
10
  *
11
- * Version 4.3.8, Thu Jan 29 2026
11
+ * Version 4.3.9, Thu Jan 29 2026
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -17298,9 +17298,7 @@
17298
17298
  };
17299
17299
  }
17300
17300
 
17301
- const isOathCallback = typeof location !== 'undefined' && !!(new URL(location.href)).searchParams.get('dxc-auth');
17302
- const getCurrentUserEmitter = associate((db) => new rxjs.BehaviorSubject(isOathCallback
17303
- ? Object.assign(Object.assign({}, UNAUTHORIZED_USER), { oauthInProgress: true }) : UNAUTHORIZED_USER));
17301
+ const getCurrentUserEmitter = associate((db) => new rxjs.BehaviorSubject(Object.assign(Object.assign({}, UNAUTHORIZED_USER), { isLoading: true })));
17304
17302
 
17305
17303
  function computeSyncState(db) {
17306
17304
  let _prevStatus = db.cloud.webSocketStatus.value;
@@ -17935,7 +17933,7 @@
17935
17933
  const syncComplete = new rxjs.Subject();
17936
17934
  dexie.cloud = {
17937
17935
  // @ts-ignore
17938
- version: "4.3.8",
17936
+ version: "4.3.9",
17939
17937
  options: Object.assign({}, DEFAULT_OPTIONS),
17940
17938
  schema: null,
17941
17939
  get currentUserId() {
@@ -18176,7 +18174,14 @@
18176
18174
  // Manage CurrentUser observable:
18177
18175
  throwIfClosed();
18178
18176
  if (!db.cloud.isServiceWorkerDB) {
18179
- subscriptions.push(Dexie.liveQuery(() => db.getCurrentUser()).subscribe(currentUserEmitter));
18177
+ subscriptions.push(Dexie.liveQuery(() => db.getCurrentUser().then(user => {
18178
+ if (!user.isLoggedIn && typeof location !== 'undefined' && /dxc-auth\=/.test(location.search)) {
18179
+ // Still loading user because OAuth redirect just happened.
18180
+ // Keep isLoading true.
18181
+ return Object.assign(Object.assign({}, user), { isLoading: true });
18182
+ }
18183
+ return user;
18184
+ })).subscribe(currentUserEmitter));
18180
18185
  // Manage PersistendSyncState observable:
18181
18186
  subscriptions.push(Dexie.liveQuery(() => db.getPersistedSyncState()).subscribe(db.cloud.persistedSyncState));
18182
18187
  // Wait till currentUser and persistedSyncState gets populated
@@ -18212,7 +18217,6 @@
18212
18217
  });
18213
18218
  // Clean up URL (remove dxc-auth param)
18214
18219
  cleanupOAuthUrl();
18215
- currentUserEmitter.next(Object.assign(Object.assign({}, currentUserEmitter.value), { oauthInProgress: false }));
18216
18220
  }
18217
18221
  catch (uiError) {
18218
18222
  console.error('[dexie-cloud] Failed to show OAuth error alert:', uiError);
@@ -18322,7 +18326,7 @@
18322
18326
  }
18323
18327
  }
18324
18328
  // @ts-ignore
18325
- dexieCloud.version = "4.3.8";
18329
+ dexieCloud.version = "4.3.9";
18326
18330
  Dexie.Cloud = dexieCloud;
18327
18331
 
18328
18332
  // In case the SW lives for a while, let it reuse already opened connections: