diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index f1087071ef9d..f3089505d15a 100755 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -528,35 +528,33 @@ function MoneyRequestConfirmationList({ const currencySymbol = currencyList?.[iouCurrencyCode ?? '']?.symbol ?? iouCurrencyCode; const formattedTotalAmount = CurrencyUtils.convertToDisplayStringWithoutCurrency(iouAmount, iouCurrencyCode); - return [payeeOption, ...selectedParticipants] - .filter((participantOption) => !PolicyUtils.isExpensifyTeam(participantOption.login)) - .map((participantOption: Participant) => ({ - ...participantOption, - tabIndex: -1, - isSelected: false, - isInteractive: !shouldDisableParticipant(participantOption), - rightElement: ( - onSplitShareChange(participantOption.accountID ?? -1, Number(value))} - maxLength={formattedTotalAmount.length} - contentWidth={formattedTotalAmount.length * 8} - /> - ), - })); + return [payeeOption, ...selectedParticipants].map((participantOption: Participant) => ({ + ...participantOption, + tabIndex: -1, + isSelected: false, + isInteractive: !shouldDisableParticipant(participantOption), + rightElement: ( + onSplitShareChange(participantOption.accountID ?? -1, Number(value))} + maxLength={formattedTotalAmount.length} + contentWidth={formattedTotalAmount.length * 8} + /> + ), + })); }, [ isTypeSplit, payeePersonalDetails, diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 072dc383feee..1968423a864c 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -6394,9 +6394,7 @@ function getMoneyRequestOptions(report: OnyxEntry, policy: OnyxEntry currentUserPersonalDetails?.accountID !== accountID && !PolicyUtils.isExpensifyTeam(allPersonalDetails?.[accountID]?.login), - ); + const otherParticipants = reportParticipants.filter((accountID) => currentUserPersonalDetails?.accountID !== accountID); const hasSingleParticipantInReport = otherParticipants.length === 1; let options: IOUType[] = []; diff --git a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx index 9c61e0178a54..5d7b5b1390c2 100644 --- a/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx +++ b/src/pages/home/report/ReportActionCompose/AttachmentPickerWithMenuItems.tsx @@ -7,7 +7,6 @@ import type {FileObject} from '@components/AttachmentModal'; import AttachmentPicker from '@components/AttachmentPicker'; import Icon from '@components/Icon'; import * as Expensicons from '@components/Icon/Expensicons'; -import {usePersonalDetails} from '@components/OnyxProvider'; import type {PopoverMenuItem} from '@components/PopoverMenu'; import PopoverMenu from '@components/PopoverMenu'; import PressableWithFeedback from '@components/Pressable/PressableWithFeedback'; @@ -123,7 +122,6 @@ function AttachmentPickerWithMenuItems({ const {translate} = useLocalize(); const {windowHeight, windowWidth} = useWindowDimensions(); const {shouldUseNarrowLayout} = useResponsiveLayout(); - const allPersonalDetails = usePersonalDetails(); /** * Returns the list of IOU Options @@ -169,8 +167,7 @@ function AttachmentPickerWithMenuItems({ return ReportUtils.temporary_getMoneyRequestOptions(report, policy, reportParticipantIDs ?? []).map((option) => ({ ...options[option], })); - // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps - }, [translate, report, policy, reportParticipantIDs, allPersonalDetails]); + }, [translate, report, policy, reportParticipantIDs]); /** * Determines if we can show the task option diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index a7457c88280d..069f86ce0899 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -10,7 +10,6 @@ import * as TransactionEdit from '@libs/actions/TransactionEdit'; import * as CurrencyUtils from '@libs/CurrencyUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; import * as TransactionUtils from '@libs/TransactionUtils'; import {getRequestType} from '@libs/TransactionUtils'; @@ -80,7 +79,6 @@ function IOURequestStepAmount({ const isSaveButtonPressed = useRef(false); const iouRequestType = getRequestType(transaction); const [reportNameValuePairs] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report?.reportID ?? -1}`); - const [allPersonalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); const isEditing = action === CONST.IOU.ACTION.EDIT; const isSplitBill = iouType === CONST.IOU.TYPE.SPLIT; @@ -255,9 +253,7 @@ function IOURequestStepAmount({ } IOU.setMoneyRequestParticipantsFromReport(transactionID, report); if (isSplitBill && !report.isOwnPolicyExpenseChat && report.participants) { - const participantAccountIDs = Object.keys(report.participants) - .map((accountID) => Number(accountID)) - .filter((accountID) => !PolicyUtils.isExpensifyTeam(allPersonalDetails?.[accountID]?.login)); + const participantAccountIDs = Object.keys(report.participants).map((accountID) => Number(accountID)); IOU.setSplitShares(transaction, amountInSmallestCurrencyUnits, currency || CONST.CURRENCY.USD, participantAccountIDs); } navigateToConfirmationPage();