@zeniai/client-epic-state 4.17.68 → 4.17.69

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.
@@ -138,15 +138,17 @@ function doUpdateTransaction(draft, id, payload, updateType) {
138
138
  const existingTransaction = draft[id];
139
139
  if (existingTransaction != null && updateType === 'merge') {
140
140
  (0, assignWith_1.default)(draft[id], transaction, (objValue, srcValue, key) => {
141
- if (key === 'lines') {
142
- if (objValue != null && srcValue != null) {
143
- const newLineIds = srcValue.map((line) => line.id);
144
- return [
145
- ...objValue.filter((line) => newLineIds.includes(line.id) === false),
146
- ...srcValue,
147
- ];
148
- }
149
- return srcValue !== null && srcValue !== void 0 ? srcValue : objValue;
141
+ if (key === 'lines' && objValue != null && srcValue != null) {
142
+ const newLineIds = srcValue.map((line) => line.id);
143
+ return [
144
+ ...objValue.filter((line) => newLineIds.includes(line.id) === false),
145
+ ...srcValue,
146
+ ];
147
+ }
148
+ else if (key === 'recommendations' &&
149
+ objValue != null &&
150
+ srcValue != null) {
151
+ return Object.assign(Object.assign({}, objValue), srcValue);
150
152
  }
151
153
  return srcValue !== null && srcValue !== void 0 ? srcValue : objValue;
152
154
  }); // IMPORTANT: replace the value only when source has valid value. Otherwise keep the existing value!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.17.68",
3
+ "version": "4.17.69",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",