@zeniai/client-epic-state 4.19.37-betaVR18 → 4.19.37-betaVR19

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.
@@ -205,12 +205,25 @@ const expenseAutomationMissingReceiptsView = createSlice({
205
205
  storeBatchDetails(draft, action) {
206
206
  const details = action.payload;
207
207
  draft.bulkUpload.batchDetailsById[details.batchId] = details;
208
+ /**
209
+ * Multi-batch fetch paths use `storeBatchDetails` (not `fetchBulkUploadBatchDetailsSuccess`).
210
+ * Without this, `phase` stays `matching` after upload forever and the Unmatched tab keeps
211
+ * showing the skeleton (`bulkUploadPhase === 'matching'` in web-components).
212
+ */
213
+ if (draft.bulkUpload.phase === 'matching' &&
214
+ draft.bulkUpload.currentBatchId === details.batchId) {
215
+ draft.bulkUpload.phase = 'completed';
216
+ }
208
217
  },
209
218
  batchDetailFetchFailed(draft, action) {
210
219
  const { batchId } = action.payload;
211
220
  if (!draft.bulkUpload.failedBatchDetailIds.includes(batchId)) {
212
221
  draft.bulkUpload.failedBatchDetailIds.push(batchId);
213
222
  }
223
+ if (draft.bulkUpload.phase === 'matching' &&
224
+ draft.bulkUpload.currentBatchId === batchId) {
225
+ draft.bulkUpload.phase = 'completed';
226
+ }
214
227
  },
215
228
  setInitialBatchDetailsLoading(draft) {
216
229
  draft.bulkUpload.batchDetailsPaginationState = {
@@ -229,6 +242,15 @@ const expenseAutomationMissingReceiptsView = createSlice({
229
242
  fetchState: 'Completed',
230
243
  error: undefined,
231
244
  };
245
+ const currentId = draft.bulkUpload.currentBatchId;
246
+ const currentDetails = currentId != null
247
+ ? draft.bulkUpload.batchDetailsById[currentId]
248
+ : undefined;
249
+ if (draft.bulkUpload.phase === 'matching' &&
250
+ currentId != null &&
251
+ currentDetails?.status === 'completed') {
252
+ draft.bulkUpload.phase = 'completed';
253
+ }
232
254
  },
233
255
  fetchMoreBatchDetailsFailure(draft, action) {
234
256
  draft.bulkUpload.batchDetailsPaginationState = {
@@ -210,12 +210,25 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
210
210
  storeBatchDetails(draft, action) {
211
211
  const details = action.payload;
212
212
  draft.bulkUpload.batchDetailsById[details.batchId] = details;
213
+ /**
214
+ * Multi-batch fetch paths use `storeBatchDetails` (not `fetchBulkUploadBatchDetailsSuccess`).
215
+ * Without this, `phase` stays `matching` after upload forever and the Unmatched tab keeps
216
+ * showing the skeleton (`bulkUploadPhase === 'matching'` in web-components).
217
+ */
218
+ if (draft.bulkUpload.phase === 'matching' &&
219
+ draft.bulkUpload.currentBatchId === details.batchId) {
220
+ draft.bulkUpload.phase = 'completed';
221
+ }
213
222
  },
214
223
  batchDetailFetchFailed(draft, action) {
215
224
  const { batchId } = action.payload;
216
225
  if (!draft.bulkUpload.failedBatchDetailIds.includes(batchId)) {
217
226
  draft.bulkUpload.failedBatchDetailIds.push(batchId);
218
227
  }
228
+ if (draft.bulkUpload.phase === 'matching' &&
229
+ draft.bulkUpload.currentBatchId === batchId) {
230
+ draft.bulkUpload.phase = 'completed';
231
+ }
219
232
  },
220
233
  setInitialBatchDetailsLoading(draft) {
221
234
  draft.bulkUpload.batchDetailsPaginationState = {
@@ -234,6 +247,15 @@ const expenseAutomationMissingReceiptsView = (0, toolkit_1.createSlice)({
234
247
  fetchState: 'Completed',
235
248
  error: undefined,
236
249
  };
250
+ const currentId = draft.bulkUpload.currentBatchId;
251
+ const currentDetails = currentId != null
252
+ ? draft.bulkUpload.batchDetailsById[currentId]
253
+ : undefined;
254
+ if (draft.bulkUpload.phase === 'matching' &&
255
+ currentId != null &&
256
+ currentDetails?.status === 'completed') {
257
+ draft.bulkUpload.phase = 'completed';
258
+ }
237
259
  },
238
260
  fetchMoreBatchDetailsFailure(draft, action) {
239
261
  draft.bulkUpload.batchDetailsPaginationState = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.19.37-betaVR18",
3
+ "version": "4.19.37-betaVR19",
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",