fix: prevent welcome message showing up on abradacabra page#20706
Conversation
mollfpr
left a comment
There was a problem hiding this comment.
Some suggestion and minor prettier issue.
| componentDidMount() { | ||
| const routes = lodashGet(this.props.navigation.getState(), 'routes', []); | ||
| const navigationState = this.props.navigation.getState(); | ||
| const currentRoute = navigationState.routes[navigationState.index]; |
There was a problem hiding this comment.
It's better we still use routes from the lodashGet to ensure the routes is not undefined and avoid error Cannot read properties of undefined.
| const routes = lodashGet(this.props.navigation.getState(), 'routes', []); | ||
| const navigationState = this.props.navigation.getState(); | ||
| const currentRoute = navigationState.routes[navigationState.index]; | ||
| if(currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) { |
There was a problem hiding this comment.
Missing space after if.
| if(currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) { | |
| if (currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) { |
| if(currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) { | ||
| return; | ||
| } | ||
| const routes = lodashGet(navigationState, 'routes', []); |
There was a problem hiding this comment.
We can put this above so routes can be used to fill currentRoute.
|
@allroundexperts @mollfpr lets wait for a confirmation from @WoLewicki would be great to have all these navigation changes under control for first couple of weeks. Changes look good to me fwiw, just good to double check |
|
Cannot we use |
Checking. |
This returns the path @WoLewicki instead of the name. |
WoLewicki
left a comment
There was a problem hiding this comment.
Hmm yeah, we use kind of a similar pattern e.g. here:
App/src/libs/Navigation/FreezeWrapper.js
Line 26 in e6201a6
Reviewer Checklist
Screenshots/VideosWeb20706.Web.movMobile Web - Chrome20706.mWeb.Chrome.webmMobile Web - Safari20706.mWeb.Safari.mp4Desktop20706.Desktop.moviOS20706.iOS.mp4Android20706.Android.webm |
|
I see Daniel is ooo today so I will go ahead and merge this |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Thanks @mountiny ! |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.29-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.3.29-11 🚀
|
Details
This PR edits the welcome menu logic such that it shows up only if the route is either
Homeor aCENTRAL_PANE_NAVIGATOR.Fixed Issues
$ #20609
PROPOSAL: #20609 (comment)
Tests
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)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
Web
Screen.Recording.2023-06-13.at.11.27.33.PM.mov
Mobile Web - Chrome
Screen.Recording.2023-06-13.at.11.58.45.PM.mov
Mobile Web - Safari
Screen.Recording.2023-06-13.at.11.57.47.PM.mov
Desktop
Screen.Recording.2023-06-13.at.11.31.50.PM.mov
iOS
ios1.mov
Android
android-1.mov