@zeniai/client-epic-state 5.1.20-betaRD1 → 5.1.20-betaRD2

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.
@@ -728,24 +728,17 @@ const expenseAutomationTransactionsView = createSlice({
728
728
  if (snapshot == null || snapshot.periodId !== periodId) {
729
729
  return;
730
730
  }
731
- const currentLocalData = draft.transactionCategorizationView[selectedTab]
732
- .transactionReviewLocalDataById;
733
- // Transactions that existed at snapshot time but were removed from the tab
734
- // during search (e.g. fully categorized via removeTransactionFromTabView).
735
- // Their local data entry is now null, but that's intentional — don't restore
736
- // them into the ID list or local data map.
737
- const removedDuringSearch = new Set(Object.keys(snapshot.transactionReviewLocalDataById).filter(id => currentLocalData[id] == null));
738
731
  draft.transactionCategorizationView[selectedTab]
739
- .transactionIdsBySelectedPeriod[periodId] = snapshot.transactionIds.filter(id => !removedDuringSearch.has(id));
732
+ .transactionIdsBySelectedPeriod[periodId] = snapshot.transactionIds;
740
733
  // Merge back per-transaction local data; skip entries that were updated
741
734
  // during the search (e.g. a save that happened while filtered results
742
735
  // were showing) so those saves are not overwritten.
743
736
  Object.entries(snapshot.transactionReviewLocalDataById).forEach(([transactionId, localData]) => {
744
- if (removedDuringSearch.has(transactionId) ||
745
- currentLocalData[transactionId] != null) {
746
- return;
737
+ if (draft.transactionCategorizationView[selectedTab]
738
+ .transactionReviewLocalDataById[transactionId] == null) {
739
+ draft.transactionCategorizationView[selectedTab]
740
+ .transactionReviewLocalDataById[transactionId] = localData;
747
741
  }
748
- currentLocalData[transactionId] = localData;
749
742
  });
750
743
  if (snapshot.totalCount != null) {
751
744
  draft.transactionCategorizationView[selectedTab].uiState.totalCount[periodId] = snapshot.totalCount;
@@ -1094,6 +1087,7 @@ const expenseAutomationTransactionsView = createSlice({
1094
1087
  if (allReviewed) {
1095
1088
  if (existsInReview) {
1096
1089
  removeTransactionFromTabView(reviewTabView, txnId);
1090
+ reviewTabView.fullDatasetSnapshot = undefined;
1097
1091
  }
1098
1092
  return;
1099
1093
  }
@@ -1140,7 +1134,9 @@ const expenseAutomationTransactionsView = createSlice({
1140
1134
  reducer(draft, action) {
1141
1135
  const { transactionId } = action.payload;
1142
1136
  for (const tab of TRANSACTIONS_TABS) {
1143
- removeTransactionFromTabView(draft.transactionCategorizationView[tab], transactionId);
1137
+ const tabView = draft.transactionCategorizationView[tab];
1138
+ removeTransactionFromTabView(tabView, transactionId);
1139
+ tabView.fullDatasetSnapshot = undefined;
1144
1140
  }
1145
1141
  },
1146
1142
  },
@@ -735,24 +735,17 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
735
735
  if (snapshot == null || snapshot.periodId !== periodId) {
736
736
  return;
737
737
  }
738
- const currentLocalData = draft.transactionCategorizationView[selectedTab]
739
- .transactionReviewLocalDataById;
740
- // Transactions that existed at snapshot time but were removed from the tab
741
- // during search (e.g. fully categorized via removeTransactionFromTabView).
742
- // Their local data entry is now null, but that's intentional — don't restore
743
- // them into the ID list or local data map.
744
- const removedDuringSearch = new Set(Object.keys(snapshot.transactionReviewLocalDataById).filter(id => currentLocalData[id] == null));
745
738
  draft.transactionCategorizationView[selectedTab]
746
- .transactionIdsBySelectedPeriod[periodId] = snapshot.transactionIds.filter(id => !removedDuringSearch.has(id));
739
+ .transactionIdsBySelectedPeriod[periodId] = snapshot.transactionIds;
747
740
  // Merge back per-transaction local data; skip entries that were updated
748
741
  // during the search (e.g. a save that happened while filtered results
749
742
  // were showing) so those saves are not overwritten.
750
743
  Object.entries(snapshot.transactionReviewLocalDataById).forEach(([transactionId, localData]) => {
751
- if (removedDuringSearch.has(transactionId) ||
752
- currentLocalData[transactionId] != null) {
753
- return;
744
+ if (draft.transactionCategorizationView[selectedTab]
745
+ .transactionReviewLocalDataById[transactionId] == null) {
746
+ draft.transactionCategorizationView[selectedTab]
747
+ .transactionReviewLocalDataById[transactionId] = localData;
754
748
  }
755
- currentLocalData[transactionId] = localData;
756
749
  });
757
750
  if (snapshot.totalCount != null) {
758
751
  draft.transactionCategorizationView[selectedTab].uiState.totalCount[periodId] = snapshot.totalCount;
@@ -1101,6 +1094,7 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
1101
1094
  if (allReviewed) {
1102
1095
  if (existsInReview) {
1103
1096
  (0, transactionCategorizationLocalDataHelper_1.removeTransactionFromTabView)(reviewTabView, txnId);
1097
+ reviewTabView.fullDatasetSnapshot = undefined;
1104
1098
  }
1105
1099
  return;
1106
1100
  }
@@ -1147,7 +1141,9 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
1147
1141
  reducer(draft, action) {
1148
1142
  const { transactionId } = action.payload;
1149
1143
  for (const tab of transactionsViewState_1.TRANSACTIONS_TABS) {
1150
- (0, transactionCategorizationLocalDataHelper_1.removeTransactionFromTabView)(draft.transactionCategorizationView[tab], transactionId);
1144
+ const tabView = draft.transactionCategorizationView[tab];
1145
+ (0, transactionCategorizationLocalDataHelper_1.removeTransactionFromTabView)(tabView, transactionId);
1146
+ tabView.fullDatasetSnapshot = undefined;
1151
1147
  }
1152
1148
  },
1153
1149
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.1.20-betaRD1",
3
+ "version": "5.1.20-betaRD2",
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
  "module": "lib/esm/index.js",