http-request-manager 18.13.35 → 18.13.36

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.
@@ -5141,12 +5141,12 @@ class LocalStorageManagerService extends ComponentStore {
5141
5141
  this.storeExists$ = (store) => this.select(this.data$, (data) => data.settings.find(item => item.name === store) ? true : false);
5142
5142
  this.store$ = (store) => this.select(this.data$, (data) => {
5143
5143
  store = store.toLowerCase();
5144
- const foundStore = data.settings.find(item => item.name === store);
5144
+ const foundStore = [...data.settings].reverse().find(item => item.name === store);
5145
5145
  if (foundStore) {
5146
5146
  const options = SettingOptions.adapt(foundStore.options);
5147
5147
  const found = foundStore.options?.storage === StorageType.GLOBAL
5148
- ? data.localStores.find(item => item.id === foundStore.id)
5149
- : data.sessionStores.find(item => item.id === foundStore.id);
5148
+ ? [...data.localStores].reverse().find(item => item.id === foundStore.id)
5149
+ : [...data.sessionStores].reverse().find(item => item.id === foundStore.id);
5150
5150
  if (!found) {
5151
5151
  console.warn('[CacheDebug] store$: settings entry found but no data entry in localStores/sessionStores', { store, foundStoreId: foundStore.id, storageType: foundStore.options?.storage });
5152
5152
  this.deleteStore({ name: store });
@@ -5181,7 +5181,7 @@ class LocalStorageManagerService extends ComponentStore {
5181
5181
  });
5182
5182
  this.settings$ = this.select(state => (state) ? state.settings : storage.settings);
5183
5183
  this.setting$ = (store) => this.select(this.data$, (state) => {
5184
- const foundSetting = state.settings.find(item => item.name === store);
5184
+ const foundSetting = [...state.settings].reverse().find(item => item.name === store);
5185
5185
  return (foundSetting) ? foundSetting : null;
5186
5186
  });
5187
5187
  this.persistence$ = this.data$
@@ -5208,11 +5208,14 @@ class LocalStorageManagerService extends ComponentStore {
5208
5208
  const dataStr = (this.isObjectOrArray(str)) ? (store.options.encrypted) ? this.encryption.encrypt(str, this.app.appID) : store.data : store.data;
5209
5209
  const localData = (dataStr && settings.options?.storage === StorageType.GLOBAL) ? [{ data: dataStr, id: settings.id }] : [];
5210
5210
  const sessionData = (dataStr && settings.options?.storage === StorageType.SESSION) ? [{ data: dataStr, id: settings.id }] : [];
5211
+ const localStores = state.localStores.filter(item => item.id !== settings.id);
5212
+ const sessionStores = state.sessionStores.filter(item => item.id !== settings.id);
5213
+ const stateSettings = state.settings.filter(item => item.id !== settings.id);
5211
5214
  return {
5212
5215
  ...state,
5213
- localStores: [...state.localStores, ...localData],
5214
- sessionStores: [...state.sessionStores, ...sessionData],
5215
- settings: [...state.settings, ...[settings]],
5216
+ localStores: [...localStores, ...localData],
5217
+ sessionStores: [...sessionStores, ...sessionData],
5218
+ settings: [...stateSettings, ...[settings]],
5216
5219
  };
5217
5220
  }
5218
5221
  });
@@ -5249,7 +5252,7 @@ class LocalStorageManagerService extends ComponentStore {
5249
5252
  this.updateStore = this.updater((state, store) => {
5250
5253
  store.name = store.name.toLowerCase();
5251
5254
  store.name = this.validStoreName(store.name);
5252
- const settings = state.settings.find(item => item.name === store.name);
5255
+ const settings = [...state.settings].reverse().find(item => item.name === store.name);
5253
5256
  if (settings) {
5254
5257
  const type = settings.options?.storage;
5255
5258
  const hasStore = this.hasGlobalStorage(type, settings.id || '');