Save the World - Navigation problem on teachers contact page after a reload#32065
Conversation
…page after a reload
|
@shubham1206agra 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] |
|
Hello ) Plus a little explanation I added conditions here so as not to see back-to on the screens if we get there from the profile (That is, the behavior remains the same as in the main branch) But I couldn’t decide how to do it right What do you think ? |
| const onBackButtonPress = () => { | ||
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | ||
| Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.route); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(navigateBackTo)); | ||
| }; |
There was a problem hiding this comment.
Use useCallback here
| const onNewContactMethodButtonPress = () => { | ||
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | ||
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.route); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.getRoute(navigateBackTo)); | ||
| }; |
There was a problem hiding this comment.
Use useCallback here
Current one seems right |
Reviewer Checklist
Screenshots/VideosAndroid: NativeNA Android: mWeb ChromeiOS: NativeNA iOS: mWeb SafariScreen.Recording.2023-11-28.at.12.07.55.PM.movMacOS: Chrome / SafariScreen.Recording.2023-11-28.at.11.57.33.AM.movMacOS: DesktopScreen.Recording.2023-11-28.at.12.33.46.PM.mov |
| const onNewContactMethodButtonPress = useCallback(() => { | ||
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | ||
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.route); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.getRoute(navigateBackTo)); | ||
| }, [navigateBackTo]); |
There was a problem hiding this comment.
| const onNewContactMethodButtonPress = useCallback(() => { | |
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | |
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.route); | |
| return; | |
| } | |
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.getRoute(navigateBackTo)); | |
| }, [navigateBackTo]); | |
| const onNewContactMethodButtonPress = useCallback(() => { | |
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | |
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.route); | |
| return; | |
| } | |
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.getRoute(navigateBackTo)); | |
| }, [navigateBackTo]); |
| const onBackButtonPress = useCallback(() => { | ||
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | ||
| Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.route); | ||
|
|
||
| return; | ||
| } | ||
|
|
||
| Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(navigateBackTo)); | ||
| }, [navigateBackTo]); |
There was a problem hiding this comment.
| const onBackButtonPress = useCallback(() => { | |
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | |
| Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.route); | |
| return; | |
| } | |
| Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(navigateBackTo)); | |
| }, [navigateBackTo]); | |
| const onBackButtonPress = useCallback(() => { | |
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | |
| Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.route); | |
| return; | |
| } | |
| Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(navigateBackTo)); | |
| }, [navigateBackTo]); |
tylerkaraszewski
left a comment
There was a problem hiding this comment.
Conflicts need to be resolved.
|
@tylerkaraszewski |
|
@tylerkaraszewski Can you merge this please? |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/tylerkaraszewski in version: 1.4.7-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.7-4 🚀
|
| if (navigateBackTo === ROUTES.SETTINGS_PROFILE) { | ||
| Navigation.navigate(ROUTES.SETTINGS_NEW_CONTACT_METHOD.route); | ||
| return; |
There was a problem hiding this comment.
@shubham1206agra can I have context why this change was necessary?
This code is being removed in #38308 to fix #38296.
So I'd like to confirm if this doesn't cause any side effect.
There was a problem hiding this comment.
I'm not sure now, as this code is old. Just run the steps in this PR to verify no problem occurs.
There was a problem hiding this comment.
Here is a little explanation of why this was done
#32065 (comment)
There was a problem hiding this comment.
Thanks, @ZhenjaHorbach and @shubham1206agra for the reply.
@mkhutornyi @akinwale I reproduced the current PR test steps on the changes I made and the output is still the same:
Details
Save the World - Navigation problem on teachers contact page after a reload
Fixed Issues
$ #31895
PROPOSAL: #31895 (comment)
Tests
I am a teacherscreenOffline tests
I am a teacherscreenQA Steps
I am a teacherscreenPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Not relevant
Android: mWeb Chrome
android.mov
iOS: Native
Not relevant
iOS: mWeb Safari
ios.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov