-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fixed currency selection on confirm step #34075
Conversation
Screen.Recording.2024-01-06.at.9.37.59.PM.mov@hoangzinh There's a slight delay in updating the currency. Is that fine as we are changing currency on unmount only? |
@shubham1206agra I recall there is related issue here https://expensify.slack.com/archives/C01GTK53T8Q/p1704368050838699 |
This will not be fixed by that. I am proposing to use a spinner while old value is present. |
ah I just want to share that "There's a slight delay in updating the currency" might cause an issue later. I think using a spinner is work around and it will cause bad UX when user see a spinner in a short time |
Can you suggest me what should we do in this case? |
@shubham1206agra sorry I was thinking about what should we do so I'm late. Wdyt about the approach here https://expensify.slack.com/archives/C01GTK53T8Q/p1704818739022579 Wait onyx updated then goBack 🤔 |
To be honest, this looks like a bad idea to just simply wait as it might look laggy to the user. I think its safe to use spinner (I know it will be a short spinner), rather than simply wait, which is actually an anti-pattern in the code. What is your opinion on this @tgolen? |
Agreed. I'm okay with Spinner. Just wanna confirm, is it a full loading screen? |
Right now, I am thinking spinner on amount only. But I think, full screen spinner would be better. |
@hoangzinh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@shubham1206agra thanks for updates, I will try to do code review within 2 days. |
@@ -318,6 +328,8 @@ function IOURequestStepConfirmation({ | |||
IOU.setMoneyRequestBillable_temporaryForRefactor(transactionID, billable); | |||
}; | |||
|
|||
const isLoading = !!(transaction && transaction.originalCurrency); |
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.
I think we need to leave comment here to explain why we have this code
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.
@shubham1206agra could you help to leave a comment here, other than that it looks good to me.
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.
Done
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.
Thanks mate
IOU.setMoneyRequestCurrency_temporaryForRefactor(transactionID, originalCurrency.current, true); | ||
}; | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); |
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.
I'm thinking is it possible if we don't need an additional useRef and modify current IOU.setMoneyRequestOriginalCurrency_temporaryForRefactor
to pass a 3rd params like current implementation.
How about?
useEffect(() => {
IOU.setMoneyRequestOriginalCurrency_temporaryForRefactor(transactionID, currency);
return () => {
if (isSaveButtonPressed.current) {
return;
}
IOU.setMoneyRequestCurrency_temporaryForRefactor(transactionID, transaction.originalCurrency);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
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.
Actually, it was creating some problems as it was keeping old values in mount / unmount.
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.
Or we can always reset originalCurrency on unmount.
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.
Let keep it this way as it helps me with cases of refresh (it will call mount again, and will set wrong value on refresh).
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.
Hi @shubham1206agra I will try to test & complete review checklist tomorrow
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-02-03.at.20.14.52.android.movAndroid: mWeb ChromeScreen.Recording.2024-02-03.at.19.45.36.android.chrome.moviOS: NativeScreen.Recording.2024-02-03.at.19.50.10.ios.moviOS: mWeb SafariScreen.Recording.2024-02-03.at.19.47.36.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-02-03.at.19.41.52.web.movMacOS: DesktopScreen.Recording.2024-02-03.at.19.43.43.desktop.mov |
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.
Looks good, thanks.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 1.4.36-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
1 similar comment
🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 1.4.36-5 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.37-7 🚀
|
This regression is caused by changes introduced in this PR. |
Details
Fixed Issues
$ #33608
PROPOSAL: #33608 (comment)
Tests
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2024-01-22.at.6.58.11.PM.mov
Android: mWeb Chrome
Screen.Recording.2024-01-22.at.5.14.11.PM.mov
iOS: Native
Screen.Recording.2024-01-22.at.6.44.34.PM.mov
iOS: mWeb Safari
Screen.Recording.2024-01-22.at.5.10.29.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2024-01-22.at.5.07.19.PM.mov
MacOS: Desktop
Screen.Recording.2024-01-22.at.6.37.29.PM.mov