http-request-manager 18.13.10 → 18.13.12

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.
@@ -1159,6 +1159,12 @@ class QueryParamsTrackerService {
1159
1159
  sessionStorage.setItem(TRACKER_SESSION_INIT_KEY, '1');
1160
1160
  }
1161
1161
  restoreState() {
1162
+ const syncState = this.localStorageManager.getStoreSync(TRACKER_STORE_NAME);
1163
+ if (this.isTrackerState(syncState)) {
1164
+ this.state = QueryTrackerStateModel.adapt(syncState);
1165
+ this.cleanupExpiredEntries();
1166
+ return;
1167
+ }
1162
1168
  this.localStorageManager.store$(TRACKER_STORE_NAME)
1163
1169
  .pipe(take(1))
1164
1170
  .subscribe({
@@ -5429,6 +5435,34 @@ const storage = {
5429
5435
  settings: [],
5430
5436
  };
5431
5437
  class LocalStorageManagerService extends ComponentStore {
5438
+ getStoreSync(storeName) {
5439
+ storeName = storeName.toLowerCase();
5440
+ const data = this.get();
5441
+ const foundStore = data.settings.find(item => item.name === storeName);
5442
+ if (!foundStore) {
5443
+ return null;
5444
+ }
5445
+ const found = foundStore.options?.storage === StorageType.GLOBAL
5446
+ ? data.localStores.find(item => item.id === foundStore.id)
5447
+ : data.sessionStores.find(item => item.id === foundStore.id);
5448
+ if (!found || !this.app?.appID) {
5449
+ return null;
5450
+ }
5451
+ const options = SettingOptions.adapt(foundStore.options);
5452
+ let storageData = found.data;
5453
+ if (options.encrypted) {
5454
+ const decryptedData = this.encryption.decrypt(found.data, this.app.appID);
5455
+ if (decryptedData !== null) {
5456
+ storageData = decryptedData;
5457
+ }
5458
+ }
5459
+ try {
5460
+ return this.isString(storageData) ? JSON.parse(storageData) : storageData;
5461
+ }
5462
+ catch {
5463
+ return storageData;
5464
+ }
5465
+ }
5432
5466
  startTimer() {
5433
5467
  const timer$ = interval(1000 * 3).pipe(withLatestFrom(this.data$), map(([_, state]) => state), tap((state) => {
5434
5468
  const expired = this.expired(state) ? this.expired(state) : [];