-
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
Fixed address clear detected & modified the state #5954
Fixed address clear detected & modified the state #5954
Conversation
@stitesExpensify had made some additional changes apart from the proposed changes. To ensure everything works well. Adding |
Something weird happened here and I think @stitesExpensify should've been assigned as a reviewer here because he's the CME on the linked issue. Also since this fixes a deploy blocker I'm assigning the |
|
src/components/AddressSearch.js
Outdated
onChangeText: (text) => { | ||
// Ensure whether an address is selected already has address value initialized. | ||
if (!_.isEmpty(googlePlacesRef.current.getAddressText())) { | ||
if (_.isEmpty(text) || !_.isEqual(text, props.value)) { |
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.
Sorry, I'm confused why we're clearing the value if text
is not the same as props.value
. Can you help me understand?
Also NAB because this is personal preference, but I'm not a fan of the nested if statements – I think something like this would be slightly clearer:
const isTextValid = !_.isEmpty(text) && _.isEqual(text, props.value);
if (!_.isEmpty(googlePlacesRef.current.getAddressText()) && !isTextValid) {
saveLocationDetails({});
}
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 confused why we're clearing the value if
text
is not the same asprops.value
. Can you help me understand?
Because it text
will change whenever you modify the address input & props.value
will update only if the address is selected in the autocomplete list.
Yes, it makes sense I'll update the suggested changes here.
@roryabraham it happened to couple more times, when @stitesExpensify was CME, his account was not getting assigned as reviewer. |
Retrying E2E tests for ya |
It's failing for all recently updated PRs. @roryabraham |
Agree it's probably unrelated |
Probably because I'm not on the contributor management team technically? |
Join us 🙃 |
@Santhosh-Sellavel can you pull main and push it up to fix e2e tests? |
@stitesExpensify if possible can you restart the iOS Tests again? I already merged once from the main. In my other PRs also, I faced the same issue it is fixed now. |
Pull from main
Merged again now let's wait and check thanks! |
Looks like it passed! CC: @roryabraham |
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.
(cherry picked from commit f5cff3f)
Testing this atm on the following environments:
|
🚀 Cherry-picked to staging by @roryabraham in version: 1.1.8-9 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by @roryabraham in version: 1.1.8-9 🚀
|
🚀 Deployed to staging by @roryabraham in version: 1.1.8-10 🚀
|
Something weird happened here – This was CP'd to staging in version |
🚀 Deployed to production by @roryabraham in version: 1.1.10-2 🚀
|
@stitesExpensify
Details
If the address was cleared in VBA Company step but
address states
was not cleared technically, updated the code that will clear theaddress states
when the address is modified.Fixed Issues
$ #5920
Tests & QA Steps
Tested On
Screenshots
Web
Mobile Web
Desktop
DESKTOP.mov
iOS
iOS_01.mp4
Android