-
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
fix: prevent welcome message showing up on abradacabra page #20706
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,6 +8,8 @@ import styles from '../../../../styles/styles'; | |||||
import * as Expensicons from '../../../../components/Icon/Expensicons'; | ||||||
import Navigation from '../../../../libs/Navigation/Navigation'; | ||||||
import ROUTES from '../../../../ROUTES'; | ||||||
import NAVIGATORS from '../../../../NAVIGATORS'; | ||||||
import SCREENS from '../../../../SCREENS'; | ||||||
import Permissions from '../../../../libs/Permissions'; | ||||||
import * as Policy from '../../../../libs/actions/Policy'; | ||||||
import PopoverMenu from '../../../../components/PopoverMenu'; | ||||||
|
@@ -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]; | ||||||
if(currentRoute && ![NAVIGATORS.CENTRAL_PANE_NAVIGATOR, SCREENS.HOME].includes(currentRoute.name)) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing space after
Suggested change
|
||||||
return; | ||||||
} | ||||||
const routes = lodashGet(navigationState, 'routes', []); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can put this above so There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||||||
Welcome.show({routes, showCreateMenu: this.showCreateMenu}); | ||||||
} | ||||||
|
||||||
|
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 thelodashGet
to ensure theroutes
is not undefined and avoid errorCannot 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.