Repository navigation
[CP Staging] Revert "Fix unable to re-split a transaction after its unreported sibling got deleted" #91549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CP Staging] Revert "Fix unable to re-split a transaction after its unreported sibling got deleted" #91549
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ import {calculateAmount} from '@libs/IOUUtils'; | |
| import isSearchTopmostFullScreenRoute from '@libs/Navigation/helpers/isSearchTopmostFullScreenRoute'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import {rand64} from '@libs/NumberUtils'; | ||
| import {getTransactionDetails} from '@libs/ReportUtils'; | ||
| import {getTransactionDetails, isOpenReport} from '@libs/ReportUtils'; | ||
| import {shouldRestrictUserBillableActions} from '@libs/SubscriptionUtils'; | ||
| import {buildOptimisticTransaction, getChildTransactions, getOriginalTransactionWithSplitInfo, isDistanceRequest} from '@libs/TransactionUtils'; | ||
| import CONST from '@src/CONST'; | ||
|
|
@@ -82,9 +82,10 @@ function initSplitExpense(transaction: OnyxEntry<Transaction>, policy?: OnyxEntr | |
| const originalTransaction = allTransactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${originalTransactionID}`]; | ||
| const {isExpenseSplit} = getOriginalTransactionWithSplitInfo(transaction, originalTransaction); | ||
| const relatedTransactions = getChildTransactions(allTransactions, allReports, originalTransactionID); | ||
| const hasMultipleSplits = getChildTransactions(allTransactions, allReports, originalTransactionID, true).length > 1; | ||
| const hasMultipleSplits = relatedTransactions.length > 1; | ||
| const transactionReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${transaction?.reportID}`]; | ||
| const shouldShowSplitIndicator = isExpenseSplit && hasMultipleSplits; | ||
| const isReportOpen = isOpenReport(transactionReport); | ||
| const shouldShowSplitIndicator = isExpenseSplit && (hasMultipleSplits || isReportOpen); | ||
|
|
||
| if (isExpenseSplit && shouldShowSplitIndicator) { | ||
|
Comment on lines
+88
to
90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This condition now routes any split child on an open report into the edit-splits flow even when only one child remains, because Useful? React with 👍 / 👎. |
||
| const transactionDetails = getTransactionDetails(originalTransaction); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bulk-actions split gate now blocks all transactions flagged as
isExpenseSplit, regardless of whether sibling split children still exist. After one split half is removed, the remaining child still has split metadata, so this check hides the Split option and prevents users from re-splitting from selected-transactions actions even though the split is no longer intact.Useful? React with 👍 / 👎.