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;
@@ -18106,7 +18104,7 @@
18106
18104
  const syncComplete = new rxjs.Subject();
18107
18105
  dexie.cloud = {
18108
18106
  // @ts-ignore
18109
- version: "4.3.8",
18107
+ version: "4.3.9",
18110
18108
  options: Object.assign({}, DEFAULT_OPTIONS),
18111
18109
  schema: null,
18112
18110
  get currentUserId() {
@@ -18347,7 +18345,14 @@
18347
18345
  // Manage CurrentUser observable:
18348
18346
  throwIfClosed();
18349
18347
  if (!db.cloud.isServiceWorkerDB) {
18350
- subscriptions.push(Dexie.liveQuery(() => db.getCurrentUser()).subscribe(currentUserEmitter));
18348
+ subscriptions.push(Dexie.liveQuery(() => db.getCurrentUser().then(user => {
18349
+ if (!user.isLoggedIn && typeof location !== 'undefined' && /dxc-auth\=/.test(location.search)) {
18350
+ // Still loading user because OAuth redirect just happened.
18351
+ // Keep isLoading true.
18352
+ return Object.assign(Object.assign({}, user), { isLoading: true });
18353
+ }
18354
+ return user;
18355
+ })).subscribe(currentUserEmitter));
18351
18356
  // Manage PersistendSyncState observable:
18352
18357
  subscriptions.push(Dexie.liveQuery(() => db.getPersistedSyncState()).subscribe(db.cloud.persistedSyncState));
18353
18358
  // Wait till currentUser and persistedSyncState gets populated
@@ -18383,7 +18388,6 @@
18383
18388
  });
18384
18389
  // Clean up URL (remove dxc-auth param)
18385
18390
  cleanupOAuthUrl();
18386
- currentUserEmitter.next(Object.assign(Object.assign({}, currentUserEmitter.value), { oauthInProgress: false }));
18387
18391
  }
18388
18392
  catch (uiError) {
18389
18393
  console.error('[dexie-cloud] Failed to show OAuth error alert:', uiError);
@@ -18493,7 +18497,7 @@
18493
18497
  }
18494
18498
  }
18495
18499
  // @ts-ignore
18496
- dexieCloud.version = "4.3.8";
18500
+ dexieCloud.version = "4.3.9";
18497
18501
  Dexie.Cloud = dexieCloud;
18498
18502
 
18499
18503
  exports.default = dexieCloud;