-
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
[$500] Request - Request money amount disappears if tap Next&Back and then switching between tabs #32739
Comments
Triggered auto assignment to @kadiealexander ( |
Job added to Upwork: https://www.upwork.com/jobs/~017941ed9191037a56 |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Request money amount disappears if tap Next&Back and then switching between tabs What is the root cause of that problem?
App/src/pages/iou/steps/MoneyRequestAmountForm.js Lines 125 to 128 in 269e866
But the reason this is not happening before the user's first click of Next is that when a user inputs an amount it will only set the currentAmount state in MoneyRequestAmountForm not iou.amount and iou.amount is 0 so navigating between tabs will not reset the currentAmount state as there will be no change in iou.amount on navigating between tabs the iou.amount is reset to 0 but iou.amount was not changed it was already 0.
What changes do you think we should make in order to solve the problem?We shouldn't reset App/src/pages/iou/steps/MoneyRequestAmountForm.js Lines 125 to 126 in 269e866
What alternative solutions did you explore? (Optional)If we don't have any special reason we can leave updating |
ProposalPlease re-state the problem that we are trying to solve in this issue.Request money amount disappears if tap Next&Back and then switching between tabs What is the root cause of that problem?When we enter first tap(manual), we reset iou. What changes do you think we should make in order to solve the problem?We need to give amount when reset
What alternative solutions did you explore? (Optional)Screen.Recording.2023-12-08.at.9.13.36.PM.mov |
ProposalPlease re-state the problem that we are trying to solve in this issue.Request amount is changing whenever we go to next step and come back again What is the root cause of that problem?We are resetting the transaction details here - Lines 113 to 121 in 138e6a2
Whenever we change the tab this method is being called. There are two instances -
This causes the amount to set zero. Screen.Recording.2023-12-09.at.1.11.27.AM.movThe reason behind that is the What changes do you think we should make in order to solve the problem?We shall pass amount to ...
IOU.startMoneyRequest_temporaryForRefactor(reportID, transactionRequestType.current, TransactionUtils.getAmount(transaction));
... and we use the amount we received as parameter to set the amount. Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${newTransactionID}`, {
amount: currentAmount,
comment,
created,
currency: lodashGet(currentUserPersonalDetails, 'localCurrencyCode', CONST.CURRENCY.USD),
iouRequestType,
reportID,
transactionID: newTransactionID,
}); Screen.Recording.2023-12-09.at.1.17.52.AM.movWhat alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Request - Request money amount disappears if tap Next&Back and then switching between tabs What is the root cause of that problem?To understand the cause of this, let's take a look at this section of the code from App/src/pages/iou/steps/MoneyRequestAmountForm.js Lines 112 to 128 in d4fb27a
So what the above code is doing is simple, if there is Now the problem is that when we proceed to the next step, the value of the amount variable will change since we are updating the amount in the onyx store, also as we navigate to other tabs after that, we are resetting that onyx store amount to initialise the other tabs, what happens because of that is that the useEffect will kick in as the amount has changed, resulting in What changes do you think we should make in order to solve the problem?Since the currentAmount will be reset to 0 anyway when we unmount and remount the component, I don't see the point in calling const initializeAmount = useCallback((newAmount) => {
const frontendAmount = newAmount ? CurrencyUtils.convertToFrontendAmount(newAmount).toString() : '';
if(frontendAmount){
setCurrentAmount(frontendAmount);
setSelection({
start: frontendAmount.length,
end: frontendAmount.length,
});
} ResultScreen.Recording.2023-12-08.at.11.01.26.PM.mov |
Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 @c3024 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
As per new expected behavior, I think we can close this. |
Yes, the expected behavior changed since this proposal was approved. Now, the suggested changes are not required. The issue may be closed. @kadiealexander @stitesExpensify Since, the issue proceeded to the point of making a PR, some compensation might be due. |
@stitesExpensify U can close this issue; from my side I am OK ❤️ with no compensation 👍 |
Great, thanks @FitseTLT ! |
Please close the PR @FitseTLT . |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.10-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
The amount previously entered is remembered and displayed on the BNP
Actual Result:
If user proceeds until attendee selector and then returns back, switching between tabs make the amount disappear
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6306099_1702060371938.1000024236.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: