diff --git a/android/app/build.gradle b/android/app/build.gradle index 1920771d2bb4..25d654513186 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -152,8 +152,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001014403 - versionName "1.1.44-3" + versionCode 1001014404 + versionName "1.1.44-4" } splits { abi { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 719ed3d648cd..bf0b269a4fdc 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -31,7 +31,7 @@ CFBundleVersion - 1.1.44.3 + 1.1.44.4 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index f2d5c1400c38..519df107fcfe 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.1.44.3 + 1.1.44.4 diff --git a/package-lock.json b/package-lock.json index 0096e5d26f54..83a63f9b596d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.44-3", + "version": "1.1.44-4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7da4ad1527ee..15478832efd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.44-3", + "version": "1.1.44-4", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", diff --git a/src/libs/actions/WelcomeActions.js b/src/libs/actions/WelcomeActions.js index c3b6c7f18d1f..f1db29c89f1e 100644 --- a/src/libs/actions/WelcomeActions.js +++ b/src/libs/actions/WelcomeActions.js @@ -68,7 +68,9 @@ function show({routes, toggleCreateMenu}) { // If we are rendering the SidebarScreen at the same time as a workspace route that means we've already created a workspace via workspace/new and should not open the global // create menu right now. const topRouteName = lodashGet(_.last(routes), 'name', ''); - const isDisplayingWorkspaceRoute = topRouteName.toLowerCase().includes('workspace'); + const loginWithShortLivedTokenRoute = _.find(routes, route => route.name === 'LogInWithShortLivedToken'); + const exitingToWorkspaceRoute = lodashGet(loginWithShortLivedTokenRoute, 'params.exitTo', '') === 'workspace/new'; + const isDisplayingWorkspaceRoute = topRouteName.toLowerCase().includes('workspace') || exitingToWorkspaceRoute; // It's also possible that we already have a workspace policy. In either case we will not toggle the menu but do still want to set the NVP in this case // since the user does not need to create a workspace. diff --git a/src/pages/LogInWithShortLivedTokenPage.js b/src/pages/LogInWithShortLivedTokenPage.js index acd8c659104b..5e091ead6f83 100644 --- a/src/pages/LogInWithShortLivedTokenPage.js +++ b/src/pages/LogInWithShortLivedTokenPage.js @@ -7,6 +7,7 @@ import ONYXKEYS from '../ONYXKEYS'; import * as Session from '../libs/actions/Session'; import FullScreenLoadingIndicator from '../components/FullscreenLoadingIndicator'; import Navigation from '../libs/Navigation/Navigation'; +import Log from '../libs/Log'; const propTypes = { /** The parameters needed to authenticate with a short lived token are in the URL */ @@ -49,44 +50,35 @@ const defaultProps = { class LogInWithShortLivedTokenPage extends Component { componentDidMount() { - const accountID = parseInt(lodashGet(this.props.route.params, 'accountID', ''), 10); + const accountID = lodashGet(this.props.route.params, 'accountID', ''); const email = lodashGet(this.props.route.params, 'email', ''); const shortLivedToken = lodashGet(this.props.route.params, 'shortLivedToken', ''); const isUserSignedIn = this.props.session && this.props.session.authToken; if (!isUserSignedIn) { + Log.info('[LoginWithShortLivedTokenPage] User not signed in - signing in with short lived token'); Session.signInWithShortLivedToken(accountID, email, shortLivedToken); return; } - this.signOutIfNeeded(email); - } - - componentDidUpdate() { - if (!lodashGet(this.props, 'session.authToken', null)) { + if (this.signOutIfNeeded(email)) { return; } - const email = lodashGet(this.props.route.params, 'email', ''); + Log.info('[LoginWithShortLivedTokenPage] User is signed in'); // exitTo is URI encoded because it could contain a variable number of slashes (i.e. "workspace/new" vs "workspace//card") const exitTo = decodeURIComponent(lodashGet(this.props.route.params, 'exitTo', '')); - - if (this.signOutIfNeeded(email)) { - return; - } - if (exitTo === ROUTES.WORKSPACE_NEW) { // New workspace creation is handled in AuthScreens, not in its own screen + Log.info('[LoginWithShortLivedTokenPage] exitTo is workspace/new - handling new workspace creation in AuthScreens'); return; } - // In order to navigate to a modal, we first have to dismiss the current modal. But there is no current - // modal you say? I know, it confuses me too. Without dismissing the current modal, if the user cancels out - // of the workspace modal, then they will be routed back to - // /transition////workspace//card and we don't want that. We want them to go back to `/` - // and by calling dismissModal(), the /transition/... route is removed from history so the user will get taken to `/` - // if they cancel out of the new workspace modal. + // In order to navigate to a modal, we first have to dismiss the current modal. Without dismissing the current modal, if the user cancels out of the workspace modal, + // then they will be routed back to /transition////workspace//card and we don't want that. We want them to go back to `/` + // and by calling dismissModal(), the /transition/... route is removed from history so the user will get taken to `/` if they cancel out of the new workspace modal. + Log.info('[LoginWithShortLivedTokenPage] Dismissing LoginWithShortLivedTokenPage and navigating to exitTo'); Navigation.dismissModal(); Navigation.navigate(exitTo); } @@ -105,6 +97,7 @@ class LogInWithShortLivedTokenPage extends Component { return false; } + Log.info('[LoginWithShortLivedTokenPage] Different user signed in - signing out'); Session.signOutAndRedirectToSignIn(); return true; } @@ -121,10 +114,4 @@ export default withOnyx({ session: { key: ONYXKEYS.SESSION, }, - - // We need to subscribe to the betas so that componentDidUpdate will run, - // causing us to exit to the proper page. - betas: { - key: ONYXKEYS.BETAS, - }, })(LogInWithShortLivedTokenPage);