@@ -56,7 +56,7 @@ import {translateLocal} from './Localize';
5656import Navigation from './Navigation/Navigation' ;
5757import Parser from './Parser' ;
5858import { getDisplayNameOrDefault } from './PersonalDetailsUtils' ;
59- import { arePaymentsEnabled , canSendInvoice , getActivePolicy , getGroupPaidPoliciesWithExpenseChatEnabled , getPolicy , isPaidGroupPolicy } from './PolicyUtils' ;
59+ import { arePaymentsEnabled , canSendInvoice , getActivePolicy , getGroupPaidPoliciesWithExpenseChatEnabled , getPolicy , isPaidGroupPolicy , isPolicyPayer } from './PolicyUtils' ;
6060import { getOriginalMessage , isCreatedAction , isDeletedAction , isMoneyRequestAction , isResolvedActionableWhisper , isWhisperActionTargetedToOthers } from './ReportActionsUtils' ;
6161import { canReview } from './ReportPreviewActionUtils' ;
6262import { isExportAction } from './ReportPrimaryActionUtils' ;
@@ -422,8 +422,8 @@ function getSuggestedSearchesVisibility(
422422 }
423423
424424 const isPaidPolicy = isPaidGroupPolicy ( policy ) ;
425+ const isPayer = isPolicyPayer ( policy , currentUserEmail ) ;
425426 const isAdmin = policy . role === CONST . POLICY . ROLE . ADMIN ;
426- const isReimburser = policy . reimburser === currentUserEmail ;
427427 const isExporter = policy . exporter === currentUserEmail ;
428428 const isApprover = policy . approver === currentUserEmail ;
429429 const isApprovalEnabled = policy . approvalMode ? policy . approvalMode !== CONST . POLICY . APPROVAL_MODE . OPTIONAL : false ;
@@ -433,16 +433,7 @@ function getSuggestedSearchesVisibility(
433433 } ) ;
434434
435435 const isEligibleForSubmitSuggestion = isPaidPolicy ;
436- const isEligibleForPaySuggestion =
437- isPaidPolicy &&
438- // eslint-disable-next-line no-nested-ternary
439- ( policy . reimbursementChoice === CONST . POLICY . REIMBURSEMENT_CHOICES . REIMBURSEMENT_YES
440- ? policy . reimburser
441- ? isReimburser
442- : isAdmin
443- : policy . reimbursementChoice === CONST . POLICY . REIMBURSEMENT_CHOICES . REIMBURSEMENT_MANUAL
444- ? isAdmin
445- : false ) ;
436+ const isEligibleForPaySuggestion = isPaidPolicy && isPayer ;
446437 const isEligibleForApproveSuggestion = isPaidPolicy && isApprovalEnabled && ( isApprover || isSubmittedTo ) ;
447438 const isEligibleForExportSuggestion = isExporter ;
448439 const isEligibleForStatementsSuggestion = isPaidPolicy && ! ! policy . areCompanyCardsEnabled && cardFeedsByPolicy [ policy . id ] ?. length > 0 ;
0 commit comments