Skip to content

Commit

Permalink
Fix split amounts not displayed in scanned splits details page
Browse files Browse the repository at this point in the history
  • Loading branch information
youssef-lr committed May 7, 2024
1 parent 51901d7 commit 0b8aa3d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -471,9 +471,8 @@ function MoneyRequestConfirmationList({
let amount: number | undefined = 0;
if (iouAmount > 0) {
amount =
isPolicyExpenseChat || !transaction?.comment?.splits
? IOUUtils.calculateAmount(selectedParticipants.length, iouAmount, iouCurrencyCode ?? '', isPayer)
: transaction.comment.splits.find((split) => split.accountID === participantOption.accountID)?.amount;
transaction?.comment?.splits?.find((split) => split.accountID === participantOption.accountID)?.amount ??
IOUUtils.calculateAmount(selectedParticipants.length, iouAmount, iouCurrencyCode ?? '', isPayer);
}
return {
...participantOption,
Expand All @@ -500,7 +499,7 @@ function MoneyRequestConfirmationList({
onAmountChange: (value: string) => onSplitShareChange(participantOption.accountID ?? 0, Number(value)),
},
}));
}, [transaction, iouCurrencyCode, isPolicyExpenseChat, onSplitShareChange, payeePersonalDetails, selectedParticipants, currencyList, iouAmount, shouldShowReadOnlySplits, StyleUtils]);
}, [transaction, iouCurrencyCode, onSplitShareChange, payeePersonalDetails, selectedParticipants, currencyList, iouAmount, shouldShowReadOnlySplits, StyleUtils]);

const isSplitModified = useMemo(() => {
if (!transaction?.splitShares) {
Expand Down

0 comments on commit 0b8aa3d

Please sign in to comment.