@hmcts/rpx-xui-common-lib 3.2.16 → 3.2.17-4454-1

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.
@@ -2152,8 +2152,6 @@ class FilterService {
2152
2152
  persist(setting, persistence) {
2153
2153
  switch (persistence) {
2154
2154
  case 'local':
2155
- this.persistLocal(setting);
2156
- break;
2157
2155
  case 'session':
2158
2156
  this.persistSession(setting);
2159
2157
  break;
@@ -2167,23 +2165,12 @@ class FilterService {
2167
2165
  if (this.filterSettings[id]) {
2168
2166
  return this.filterSettings[id];
2169
2167
  }
2170
- if (sessionStorage.getItem(id)) {
2171
- return JSON.parse(sessionStorage.getItem(id));
2172
- }
2173
- if (localStorage.getItem(id)) {
2174
- if (this.isSameUser(id)) {
2175
- return JSON.parse(window.localStorage.getItem(id));
2176
- }
2177
- else {
2178
- return null;
2179
- }
2168
+ const storedSetting = sessionStorage.getItem(id);
2169
+ if (storedSetting) {
2170
+ return JSON.parse(storedSetting);
2180
2171
  }
2181
2172
  return null;
2182
2173
  }
2183
- isSameUser(id) {
2184
- const filterSetting = JSON.parse(window.localStorage.getItem(id));
2185
- return !!filterSetting.idamId && filterSetting.idamId === this.getUserId();
2186
- }
2187
2174
  getStream(id) {
2188
2175
  if (!this.streams[id]) {
2189
2176
  this.streams[id] = new BehaviorSubject(this.get(id));
@@ -2192,7 +2179,6 @@ class FilterService {
2192
2179
  }
2193
2180
  clearSessionAndLocalPersistance(id) {
2194
2181
  sessionStorage.removeItem(id);
2195
- localStorage.removeItem(id);
2196
2182
  if (this.filterSettings[id] !== undefined) {
2197
2183
  this.filterSettings[id] = null;
2198
2184
  }
@@ -2200,10 +2186,6 @@ class FilterService {
2200
2186
  this.streams[id].next(null);
2201
2187
  }
2202
2188
  }
2203
- persistLocal(setting) {
2204
- setting.idamId = this.getUserId();
2205
- window.localStorage.setItem(setting.id, JSON.stringify(setting));
2206
- }
2207
2189
  persistSession(setting) {
2208
2190
  sessionStorage.setItem(setting.id, JSON.stringify(setting));
2209
2191
  }