@arbidocs/react 0.5.92 → 0.5.94

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.
@@ -698,8 +698,13 @@ function createRecordStore(dbName) {
698
698
  let dbPromise = null;
699
699
  function openDB() {
700
700
  if (dbPromise) return dbPromise;
701
+ let request;
702
+ try {
703
+ request = indexedDB.open(dbName, DB_VERSION);
704
+ } catch (error) {
705
+ return Promise.reject(error);
706
+ }
701
707
  dbPromise = new Promise((resolve, reject) => {
702
- const request = indexedDB.open(dbName, DB_VERSION);
703
708
  request.onerror = () => {
704
709
  dbPromise = null;
705
710
  reject(request.error);
@@ -1106,11 +1111,11 @@ function useAccountClient() {
1106
1111
  return { client: fallback, enabled: arbi.isLoggedIn };
1107
1112
  }
1108
1113
  function useEntitlements() {
1109
- const arbi = chunkBRFRQWAY_cjs.useArbi();
1114
+ const { arbi } = chunkBRFRQWAY_cjs.useArbiHost();
1110
1115
  return reactQuery.useQuery({
1111
1116
  queryKey: chunkBRFRQWAY_cjs.arbiQueryKeys.entitlements(),
1112
1117
  queryFn: () => arbi.account.entitlements(),
1113
- enabled: arbi.isLoggedIn,
1118
+ enabled: !!arbi?.isLoggedIn,
1114
1119
  // A plan change shows on the next read; the API enforces it at once either way.
1115
1120
  staleTime: 5 * 60 * 1e3
1116
1121
  });
@@ -2943,5 +2948,5 @@ exports.useUserSettings = useUserSettings;
2943
2948
  exports.wipeOfflineMail = wipeOfflineMail;
2944
2949
  exports.wrapTrackKey = wrapTrackKey;
2945
2950
  exports.writeSamples = writeSamples;
2946
- //# sourceMappingURL=chunk-X4HGUBWU.cjs.map
2947
- //# sourceMappingURL=chunk-X4HGUBWU.cjs.map
2951
+ //# sourceMappingURL=chunk-CSYZ3YI4.cjs.map
2952
+ //# sourceMappingURL=chunk-CSYZ3YI4.cjs.map