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
20 changes: 20 additions & 0 deletions src/libs/Navigation/AppNavigator/AuthScreens.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ const propTypes = {
/** The last Onyx update ID was applied to the client */
lastUpdateIDAppliedToClient: PropTypes.number,

/** Information about any currently running demos */
demoInfo: PropTypes.shape({
saastr: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
sbe: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
}),

...windowDimensionsPropTypes,
};

Expand All @@ -115,6 +125,7 @@ const defaultProps = {
},
lastOpenedPublicRoomID: null,
lastUpdateIDAppliedToClient: null,
demoInfo: {},
};

class AuthScreens extends React.Component {
Expand Down Expand Up @@ -151,6 +162,12 @@ class AuthScreens extends React.Component {
App.setUpPoliciesAndNavigate(this.props.session, !this.props.isSmallScreenWidth);
App.redirectThirdPartyDesktopSignIn();

// Check if we should be running any demos immediately after signing in.
if (lodashGet(this.props.demoInfo, 'saastr.isBeginningDemo', false)) {
Navigation.navigate(ROUTES.SAASTR);
} else if (lodashGet(this.props.demoInfo, 'sbe.isBeginningDemo', false)) {
Navigation.navigate(ROUTES.SBE);
}
if (this.props.lastOpenedPublicRoomID) {
// Re-open the last opened public room if the user logged in from a public room link
Report.openLastOpenedPublicRoom(this.props.lastOpenedPublicRoomID);
Expand Down Expand Up @@ -316,5 +333,8 @@ export default compose(
lastUpdateIDAppliedToClient: {
key: ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT,
},
demoInfo: {
key: ONYXKEYS.DEMO_INFO,
},
}),
)(AuthScreens);
3 changes: 3 additions & 0 deletions src/pages/signin/SignInPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const propTypes = {
saastr: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
sbe: PropTypes.shape({
isBeginningDemo: PropTypes.bool,
}),
}),
};

Expand Down