Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/ParticipantPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function ParticipantPicker({
action={action}
isPerDiemRequest={isPerDiemRequest}
isTimeRequest={isTimeRequest}
onRestrictedParticipantSelected={onClose}
/>
);

Expand Down
5 changes: 5 additions & 0 deletions src/pages/iou/request/MoneyRequestParticipantsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ type MoneyRequestParticipantsSelectorProps = {
/** Whether to find the participant matching initiallySelectedReportID and move it to the top of the list */
shouldMoveSelectedToTop?: boolean;

/** Callback to handle restricted participant selection */
onRestrictedParticipantSelected?: () => void;

/** Reference to the outer element */
ref?: Ref<InputFocusRef>;
};
Expand All @@ -62,6 +65,7 @@ function MoneyRequestParticipantsSelector({
isCorporateCardTransaction = false,
initiallySelectedReportID,
shouldMoveSelectedToTop = false,
onRestrictedParticipantSelected,
ref,
}: MoneyRequestParticipantsSelectorProps) {
const platform = getPlatform();
Expand Down Expand Up @@ -95,6 +99,7 @@ function MoneyRequestParticipantsSelector({
onFinish={onFinish}
initiallySelectedReportID={initiallySelectedReportID}
shouldMoveSelectedToTop={shouldMoveSelectedToTop}
onRestrictedParticipantSelected={onRestrictedParticipantSelected}
/>
);
}
Expand Down
5 changes: 5 additions & 0 deletions src/pages/iou/request/ParticipantSearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ type ParticipantSearchResultsProps = {

/** Whether to find the participant matching initiallySelectedReportID and move it to the top of the list */
shouldMoveSelectedToTop?: boolean;

/** Callback to handle restricted participant selection */
onRestrictedParticipantSelected?: () => void;
};

function ParticipantSearchResults({
Expand All @@ -118,6 +121,7 @@ function ParticipantSearchResults({
onFinish,
initiallySelectedReportID,
shouldMoveSelectedToTop = false,
onRestrictedParticipantSelected,
}: ParticipantSearchResultsProps) {
const getParticipantOptionKey = (option: Partial<Participant>) => option.reportID ?? option.accountID?.toString() ?? option.login ?? option.phoneNumber ?? '';
const isIOUSplit = iouType === CONST.IOU.TYPE.SPLIT;
Expand Down Expand Up @@ -453,6 +457,7 @@ function ParticipantSearchResults({
optionPolicy &&
shouldRestrictUserBillableActions(optionPolicy, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed, currentUserAccountID)
) {
onRestrictedParticipantSelected?.();
Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(option.policyID));
return;
}
Expand Down
Loading