wt-front-shared 1.0.61 → 1.0.63

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.
@@ -6027,11 +6027,16 @@ const _staticDataReducer$2 = createReducer(initialState$3, on(StaticDataGetList,
6027
6027
  if (!newsState['list'][staticDataType]) {
6028
6028
  newsState['list'][staticDataType] = { [storeSubSection]: {} };
6029
6029
  }
6030
- if (!keepState) {
6031
- newsState['list'][staticDataType][storeSubSection] = Array.isArray(data) ? [...data] : [];
6030
+ if (keepState && state.list[staticDataType]?.[storeSubSection]) {
6031
+ let currentList = [...state.list[staticDataType][storeSubSection]];
6032
+ const newIds = data.map(item => item.id);
6033
+ if (currentList?.length) {
6034
+ currentList = currentList.filter(listItem => !newIds.includes(listItem.id));
6035
+ }
6036
+ newsState['list'][staticDataType][storeSubSection] = Array.isArray(data) ? [...currentList, ...data] : [];
6032
6037
  }
6033
6038
  else {
6034
- newsState['list'][staticDataType][storeSubSection] = Array.isArray(data) ? [...state.list[staticDataType][storeSubSection], ...data] : [];
6039
+ newsState['list'][staticDataType][storeSubSection] = Array.isArray(data) ? [...data] : [];
6035
6040
  }
6036
6041
  newsState['meta'][staticDataType] = {
6037
6042
  ...newsState['meta']?.[staticDataType],