Skip to content

Commit 25e00d5

Browse files
Enhance policy checks in getSuggestedSearchesVisibility function
1 parent fb72406 commit 25e00d5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/libs/SearchUIUtils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,11 @@ function getSuggestedSearchesVisibility(
916916
shouldShowTopCategoriesSuggestion ||= isEligibleForTopCategoriesSuggestion;
917917
shouldShowTopMerchantsSuggestion ||= isEligibleForTopMerchantsSuggestion;
918918
hasGroupPoliciesWithExpenseChat ||=
919-
isPaidPolicy && !!policy.isPolicyExpenseChatEnabled && !policy.isJoinRequestPending && policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE && !!policy.role;
919+
isPaidPolicy &&
920+
!!policy.isPolicyExpenseChatEnabled &&
921+
!policy.isJoinRequestPending &&
922+
(policy.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || Object.keys(policy.errors ?? {}).length > 0) &&
923+
!!policy.role;
920924
shouldShowSpendOverTimeSuggestion ||= isEligibleForSpendOverTimeSuggestion;
921925

922926
// We don't need to check the rest of the policies if we already determined that all suggestions should be displayed

0 commit comments

Comments
 (0)