Skip to content

Commit 5967cec

Browse files
MelvinBotsituchan
andcommitted
Pass splitExpensesTotal when updating splits after offline deletion
When deleting a split child transaction offline, useDeleteTransactions calls updateSplitTransactions without splitExpensesTotal. This causes it to default to 0, making changesInReportTotal equal to the sum of remaining splits instead of 0. The report total then incorrectly adds those amounts on top of the existing total. Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
1 parent a8dad1c commit 5967cec

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/hooks/useDeleteTransactions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac
158158
reportID: report?.reportID ?? String(CONST.DEFAULT_NUMBER_ID),
159159
originalTransactionID: transactionID,
160160
splitExpenses: remainingSplitExpenses,
161+
splitExpensesTotal: remainingSplitExpenses.reduce((total, item) => total + item.amount, 0),
161162
},
162163
searchContext: {
163164
currentSearchHash,

0 commit comments

Comments
 (0)