@zeniai/client-epic-state 4.15.87 → 4.15.88

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.
@@ -114,7 +114,7 @@ const expenseAutomationFluxAnalysisView = (0, toolkit_1.createSlice)({
114
114
  handleFetchCompletion(draft, selectedPeriod, fetchReimbursement, groupToBeFetched);
115
115
  draft.fetchState = 'Completed';
116
116
  // Update flux analysis entities
117
- const allFluxAnalysisEntities = updateFluxAnalysisEntities(draft.fluxAnalysisEntities, expensesPayload, currency);
117
+ const allFluxAnalysisEntities = updateFluxAnalysisEntities(draft.fluxAnalysisEntities, expensesPayload, currency, keepExistingListItems);
118
118
  // Update operating expense ids based on the "keepExistingListItems" flag
119
119
  updateOperatingExpenseIds(draft, selectedPeriod, groupToBeFetched, fluxOpExEntityIds, fetchReimbursement, keepExistingListItems);
120
120
  // Update total balances and variance if available
@@ -306,11 +306,13 @@ const handleFetchCompletion = (draft, selectedPeriod, fetchReimbursement, groupT
306
306
  }
307
307
  };
308
308
  // Helper function to update flux analysis entities
309
- const updateFluxAnalysisEntities = (existingEntities, expensesPayload, currency) => {
309
+ const updateFluxAnalysisEntities = (existingEntities, expensesPayload, currency, keepExistingListItems = false) => {
310
310
  const incomingExpenses = toFluxAnalysisOperatingExpenses(expensesPayload, currency);
311
311
  const allExpensesMap = new Map();
312
312
  // Preserve existing
313
- existingEntities.operatingExpenses.forEach((e) => allExpensesMap.set(e.fluxAnalysisEntityId, e));
313
+ if (keepExistingListItems === true) {
314
+ existingEntities.operatingExpenses.forEach((e) => allExpensesMap.set(e.fluxAnalysisEntityId, e));
315
+ }
314
316
  incomingExpenses.forEach((e) => allExpensesMap.set(e.fluxAnalysisEntityId, e));
315
317
  return { operatingExpenses: Array.from(allExpensesMap.values()) };
316
318
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.15.87",
3
+ "version": "4.15.88",
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",