From 48e49236733d7f5a9ffce8feda21ec157bcbce15 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 2 Oct 2024 15:32:34 +0100 Subject: [PATCH 1/2] don't show just track it unless on CombinedTrackSubmit --- src/pages/iou/request/step/IOURequestStepParticipants.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.tsx b/src/pages/iou/request/step/IOURequestStepParticipants.tsx index 7449042141f3..b27e61df743c 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.tsx +++ b/src/pages/iou/request/step/IOURequestStepParticipants.tsx @@ -46,7 +46,7 @@ function IOURequestStepParticipants({ const {translate} = useLocalize(); const styles = useThemeStyles(); const isFocused = useIsFocused(); - const {canUseP2PDistanceRequests} = usePermissions(iouType); + const {canUseP2PDistanceRequests, canUseCombinedTrackSubmit} = usePermissions(iouType); // We need to set selectedReportID if user has navigated back from confirmation page and navigates to confirmation page with already selected participant const selectedReportID = useRef(participants?.length === 1 ? participants.at(0)?.reportID ?? reportID : reportID); @@ -76,7 +76,7 @@ function IOURequestStepParticipants({ }, [iouType, translate, isSplitRequest, action]); const selfDMReportID = useMemo(() => ReportUtils.findSelfDMReportID(), []); - const shouldDisplayTrackExpenseButton = !!selfDMReportID; + const shouldDisplayTrackExpenseButton = !!selfDMReportID && canUseCombinedTrackSubmit; const receiptFilename = transaction?.filename; const receiptPath = transaction?.receipt?.source; From 45ce5f5c9794bbb4bb40b8aefcc6632d95b65469 Mon Sep 17 00:00:00 2001 From: Georgia Monahan Date: Wed, 2 Oct 2024 15:46:17 +0100 Subject: [PATCH 2/2] fix :) --- src/pages/iou/request/step/IOURequestStepParticipants.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.tsx b/src/pages/iou/request/step/IOURequestStepParticipants.tsx index b27e61df743c..e8f02f0c1975 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.tsx +++ b/src/pages/iou/request/step/IOURequestStepParticipants.tsx @@ -46,7 +46,7 @@ function IOURequestStepParticipants({ const {translate} = useLocalize(); const styles = useThemeStyles(); const isFocused = useIsFocused(); - const {canUseP2PDistanceRequests, canUseCombinedTrackSubmit} = usePermissions(iouType); + const {canUseP2PDistanceRequests} = usePermissions(iouType); // We need to set selectedReportID if user has navigated back from confirmation page and navigates to confirmation page with already selected participant const selectedReportID = useRef(participants?.length === 1 ? participants.at(0)?.reportID ?? reportID : reportID); @@ -76,7 +76,7 @@ function IOURequestStepParticipants({ }, [iouType, translate, isSplitRequest, action]); const selfDMReportID = useMemo(() => ReportUtils.findSelfDMReportID(), []); - const shouldDisplayTrackExpenseButton = !!selfDMReportID && canUseCombinedTrackSubmit; + const shouldDisplayTrackExpenseButton = !!selfDMReportID && action === CONST.IOU.ACTION.CREATE; const receiptFilename = transaction?.filename; const receiptPath = transaction?.receipt?.source;