Repository navigation
Address #5047 - Open global create when a user logs in for the first time #5214
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
Changes from all commits
2ed6a9e
2435e8c
50266cb
11655a4
bff1ae0
b772319
9629f98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,11 +25,15 @@ import Permissions from '../../../libs/Permissions'; | |
| import ONYXKEYS from '../../../ONYXKEYS'; | ||
| import {create} from '../../../libs/actions/Policy'; | ||
| import Performance from '../../../libs/Performance'; | ||
| import NameValuePair from '../../../libs/actions/NameValuePair'; | ||
|
|
||
| const propTypes = { | ||
| /** Beta features list */ | ||
| /* Beta features list */ | ||
| betas: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
|
|
||
| /* Flag for new users used to open the Global Create menu on first load */ | ||
| isFirstTimeNewExpensifyUser: PropTypes.bool.isRequired, | ||
|
|
||
| ...windowDimensionsPropTypes, | ||
|
|
||
| ...withLocalizePropTypes, | ||
|
|
@@ -52,6 +56,16 @@ class SidebarScreen extends Component { | |
| componentDidMount() { | ||
| Performance.markStart(CONST.TIMING.SIDEBAR_LOADED); | ||
| Timing.start(CONST.TIMING.SIDEBAR_LOADED, true); | ||
|
|
||
| if (this.props.isFirstTimeNewExpensifyUser) { | ||
| // For some reason, the menu doesn't open without the timeout | ||
| setTimeout(() => { | ||
| this.toggleCreateMenu(); | ||
|
|
||
| // Set the NVP back to false (this may need to be moved if this NVP is used for anything else later) | ||
|
Contributor
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.
This comment isn't really useful. Why are we thinking about what we might do with this later. Let's just focus on what we are using it for now because we don't know how else it would be used or why that would make a difference to the code here. |
||
| NameValuePair.set(CONST.NVP.IS_FIRST_TIME_NEW_EXPENSIFY_USER, false, ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER); | ||
| }, 200); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -170,5 +184,8 @@ export default compose( | |
| betas: { | ||
| key: ONYXKEYS.BETAS, | ||
| }, | ||
| isFirstTimeNewExpensifyUser: { | ||
| key: ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER, | ||
| }, | ||
| }), | ||
| )(SidebarScreen); | ||
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.
This isn't really an acceptable solution and we should try to avoid adding things to the code that we don't understand.