-
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
fix: prevent welcome message showing up on abradacabra page #20706
Conversation
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.
Some suggestion and minor prettier issue.
@@ -81,7 +83,12 @@ class FloatingActionButtonAndPopover extends React.Component { | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.
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.
Fixed.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can put this above so routes
can be used to fill currentRoute
.
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.
Fixed.
@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. |
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.
Hmm yeah, we use kind of a similar pattern e.g. here:
App/src/libs/Navigation/FreezeWrapper.js
Line 26 in e6201a6
const index = lodashFindIndex(navigation.getState().routes, (route) => route.key === currentRoute.key); |
Reviewer Checklist
Screenshots/VideosWeb20706.Web.movMobile Web - Chrome20706.mWeb.Chrome.webmMobile Web - Safari20706.mWeb.Safari.mp4Desktop20706.Desktop.moviOS20706.iOS.mp4Android20706.Android.webm |
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.
LGTM and tests well 👍
All yours @dangrous
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 everyone!
all yours @dangrous
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
Home
or aCENTRAL_PANE_NAVIGATOR
.Fixed Issues
$ #20609
PROPOSAL: #20609 (comment)
Tests
Offline tests
N/A
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
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