Skip to content

Commit e0250b5

Browse files
authored
Merge pull request Expensify#64219 from truph01/fix/63216
fix: After deleting IOU, nothing to show is shown briefly
2 parents de3f8af + 93509c1 commit e0250b5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/pages/Search/EmptySearchView.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ function EmptySearchView({hash, type, groupBy, hasResults}: EmptySearchViewProps
8888
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: false});
8989
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
9090
const [activePolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID}`, {canBeMissing: true});
91+
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {
92+
canBeMissing: true,
93+
});
9194

9295
const groupPoliciesWithChatEnabled = getGroupPaidPoliciesWithExpenseChatEnabled();
9396

@@ -288,7 +291,7 @@ function EmptySearchView({hash, type, groupBy, hasResults}: EmptySearchViewProps
288291
lottieWebViewStyles: {backgroundColor: theme.travelBG, ...styles.emptyStateFolderWebStyles, ...styles.tripEmptyStateLottieWebView},
289292
};
290293
case CONST.SEARCH.DATA_TYPES.EXPENSE:
291-
if (!hasResults) {
294+
if (!hasResults || Object.values(transactions ?? {}).length === 0) {
292295
return {
293296
...defaultViewItemHeader,
294297
title: translate('search.searchResults.emptyExpenseResults.title'),
@@ -383,6 +386,7 @@ function EmptySearchView({hash, type, groupBy, hasResults}: EmptySearchViewProps
383386
shouldRedirectToExpensifyClassic,
384387
viewTourReport,
385388
viewTourReportID,
389+
transactions,
386390
]);
387391

388392
return (

0 commit comments

Comments
 (0)