@zeniai/client-epic-state 4.19.84-betaVR4 → 4.19.84-betaVR6
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.
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +10 -5
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +4 -3
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +10 -5
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +4 -3
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +4 -0
- package/package.json +1 -1
|
@@ -16,12 +16,17 @@ export const MANUAL_TRANSACTION_SEARCH_AUTO_CATEGORIZED = false;
|
|
|
16
16
|
export const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI) => {
|
|
17
17
|
const searchActions$ = actions$.pipe(filter(searchTransactionsForManualMatch.match));
|
|
18
18
|
const pagination$ = searchActions$.pipe(filter((a) => a.payload.pageToken != null));
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* No API for empty or 1-char queries; immediate merge so switchMap cancels any in-flight HTTP.
|
|
21
|
+
*/
|
|
22
|
+
const newSearchTooShortOrClear$ = searchActions$.pipe(filter((a) => a.payload.pageToken == null &&
|
|
23
|
+
a.payload.query.trim().length < 2));
|
|
24
|
+
const newSearchDebounced$ = searchActions$.pipe(filter((a) => a.payload.pageToken == null &&
|
|
25
|
+
a.payload.query.trim().length >= 2), debounceTime(300));
|
|
26
|
+
return merge(pagination$, newSearchTooShortOrClear$, newSearchDebounced$).pipe(switchMap((action) => {
|
|
23
27
|
const { query, pageToken } = action.payload;
|
|
24
|
-
if (pageToken == null &&
|
|
28
|
+
if (pageToken == null &&
|
|
29
|
+
query.trim().length < 2) {
|
|
25
30
|
return EMPTY;
|
|
26
31
|
}
|
|
27
32
|
const state = state$.value;
|
|
@@ -386,10 +386,11 @@ const expenseAutomationMissingReceiptsView = createSlice({
|
|
|
386
386
|
const isLoadMore = pageToken != null;
|
|
387
387
|
const trimmed = query.trim();
|
|
388
388
|
/**
|
|
389
|
-
* Cleared
|
|
390
|
-
*
|
|
389
|
+
* Cleared or too-short query: no API (see epic). Reset fully (no In-Progress) so loading
|
|
390
|
+
* UI never shows; bump key so inputs remount.
|
|
391
391
|
*/
|
|
392
|
-
if (!isLoadMore &&
|
|
392
|
+
if (!isLoadMore &&
|
|
393
|
+
trimmed.length < 2) {
|
|
393
394
|
draft.bulkUpload.manualSearch = initialBulkUploadState.manualSearch;
|
|
394
395
|
draft.bulkUpload.manualSearchUiResetKey += 1;
|
|
395
396
|
return;
|