Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/ONYXKEYS.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default {
// Holds information about the users account that is logging in
ACCOUNT: 'account',

// Boolean flag only true when first set
NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER: 'isFirstTimeNewExpensifyUser',

// Holds an array of client IDs which is used for multi-tabs on web in order to know
// which tab is the leader, and which ones are the followers
ACTIVE_CLIENTS: 'activeClients',
Expand Down
2 changes: 1 addition & 1 deletion src/components/FAB/FAB.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AnimatedPressable.displayName = 'AnimatedPressable';
class FAB extends PureComponent {
constructor(props) {
super(props);
this.animatedValue = new Animated.Value(0);
this.animatedValue = new Animated.Value(props.isActive ? 1 : 0);
}

componentDidUpdate(prevProps) {
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class AuthScreens extends React.Component {

// Fetch some data we need on initialization
NameValuePair.get(CONST.NVP.PRIORITY_MODE, ONYXKEYS.NVP_PRIORITY_MODE, 'default');
NameValuePair.get(CONST.NVP.IS_FIRST_TIME_NEW_EXPENSIFY_USER, ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER, true);

API.Get({
returnValueList: 'nameValuePairs',
Expand Down
19 changes: 18 additions & 1 deletion src/pages/home/sidebar/SidebarScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, the menu doesn't open without the timeout

This isn't really an acceptable solution and we should try to avoid adding things to the code that we don't understand.

this.toggleCreateMenu();

// Set the NVP back to false (this may need to be moved if this NVP is used for anything else later)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this may need to be moved if this NVP is used for anything else later)

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);
}
}

/**
Expand Down Expand Up @@ -170,5 +184,8 @@ export default compose(
betas: {
key: ONYXKEYS.BETAS,
},
isFirstTimeNewExpensifyUser: {
key: ONYXKEYS.NVP_IS_FIRST_TIME_NEW_EXPENSIFY_USER,
},
}),
)(SidebarScreen);