-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: loading indicator display when deleting vague distance Expense #51940
Changes from 13 commits
1fff908
41f25da
0fab945
fcf7f3f
65b343b
10fb70b
3ac6241
38b088c
d332cb7
12a0a68
70fb37d
173a51e
8353a82
3ecf918
a90580a
d71f1eb
4149884
5117bec
9d570a1
cc1ef7f
f104ffd
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 |
---|---|---|
|
@@ -5587,9 +5587,10 @@ function prepareToCleanUpMoneyRequest(transactionID: string, reportAction: OnyxT | |
* @param transactionID - The transactionID of IOU | ||
* @param reportAction - The reportAction of the transaction in the IOU report | ||
* @param isSingleTransactionView - whether we are in the transaction thread report | ||
* @param onlyCleanupActions - whether we only clear the reportActions data | ||
* @return the url to navigate back once the money request is deleted | ||
*/ | ||
function cleanUpMoneyRequest(transactionID: string, reportAction: OnyxTypes.ReportAction, isSingleTransactionView = false) { | ||
function cleanUpMoneyRequest(transactionID: string, reportAction: OnyxTypes.ReportAction, isSingleTransactionView = false, onlyCleanupActions = false) { | ||
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. Instead of calling |
||
const { | ||
shouldDeleteTransactionThread, | ||
shouldDeleteIOUReport, | ||
|
@@ -5606,27 +5607,28 @@ function cleanUpMoneyRequest(transactionID: string, reportAction: OnyxTypes.Repo | |
// build Onyx data | ||
|
||
// Onyx operations to delete the transaction, update the IOU report action and chat report action | ||
const onyxUpdatesActions: OnyxUpdate[] = []; | ||
truph01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const onyxUpdates: OnyxUpdate[] = [ | ||
{ | ||
onyxMethod: Onyx.METHOD.SET, | ||
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, | ||
value: null, | ||
}, | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport?.reportID}`, | ||
value: { | ||
[reportAction.reportActionID]: shouldDeleteIOUReport | ||
? null | ||
: { | ||
pendingAction: null, | ||
}, | ||
}, | ||
}, | ||
]; | ||
onyxUpdatesActions.push({ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport?.reportID}`, | ||
value: { | ||
[reportAction.reportActionID]: shouldDeleteIOUReport | ||
? null | ||
: { | ||
pendingAction: null, | ||
}, | ||
}, | ||
}); | ||
|
||
if (reportPreviewAction?.reportActionID) { | ||
onyxUpdates.push({ | ||
onyxUpdatesActions.push({ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport?.reportID}`, | ||
value: { | ||
|
@@ -5663,12 +5665,12 @@ function cleanUpMoneyRequest(transactionID: string, reportAction: OnyxTypes.Repo | |
} | ||
|
||
// added operations to update IOU report and chat report | ||
onyxUpdatesActions.push({ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport?.reportID}`, | ||
value: updatedReportAction, | ||
}); | ||
onyxUpdates.push( | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport?.reportID}`, | ||
value: updatedReportAction, | ||
}, | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport?.reportID}`, | ||
|
@@ -5719,7 +5721,7 @@ function cleanUpMoneyRequest(transactionID: string, reportAction: OnyxTypes.Repo | |
); | ||
} | ||
|
||
Onyx.update(onyxUpdates); | ||
Onyx.update(onlyCleanupActions ? onyxUpdatesActions : onyxUpdates); | ||
|
||
return urlToNavigateBack; | ||
} | ||
|
@@ -8550,6 +8552,7 @@ export { | |
completePaymentOnboarding, | ||
payInvoice, | ||
payMoneyRequest, | ||
prepareToCleanUpMoneyRequest, | ||
truph01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
putOnHold, | ||
replaceReceipt, | ||
requestMoney, | ||
|
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.
@truph01 Is there any specific reason for handling web differently?
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.
During testing, I noticed differences in processing speed in Onyx and navigation between web versus native platforms. Therefore, I need to account for the specific platform in this case.