diff --git a/android/app/build.gradle b/android/app/build.gradle index e50c9a088039c..5b0b33aa40d90 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -90,8 +90,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001038409 - versionName "1.3.84-9" + versionCode 1001038410 + versionName "1.3.84-10" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 3fe58e3e21a75..5de4361c7f65f 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.3.84.9 + 1.3.84.10 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index c53f2d7062ba9..498b6a5744d90 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.3.84.9 + 1.3.84.10 diff --git a/package-lock.json b/package-lock.json index 8f348e40573c6..8827d2ebfd1b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.3.84-9", + "version": "1.3.84-10", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.3.84-9", + "version": "1.3.84-10", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 46b860474ce24..5b0fe7ee4d35d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.3.84-9", + "version": "1.3.84-10", "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/SCREENS.ts b/src/SCREENS.ts index 69f905e4a7a32..8ef787edec2ea 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -2,17 +2,15 @@ * This is a file containing constants for all of the screen names. In most cases, we should use the routes for * navigation. But there are situations where we may need to access screen names directly. */ -const PROTECTED_SCREENS = { - HOME: 'Home', - CONCIERGE: 'Concierge', - REPORT_ATTACHMENTS: 'ReportAttachments', -} as const; - export default { - ...PROTECTED_SCREENS, + HOME: 'Home', LOADING: 'Loading', REPORT: 'Report', + REPORT_ATTACHMENTS: 'ReportAttachments', NOT_FOUND: 'not-found', + TRANSITION_BETWEEN_APPS: 'TransitionBetweenApps', + VALIDATE_LOGIN: 'ValidateLogin', + CONCIERGE: 'Concierge', SETTINGS: { ROOT: 'Settings_Root', PREFERENCES: 'Settings_Preferences', @@ -25,11 +23,10 @@ export default { SAVE_THE_WORLD: { ROOT: 'SaveTheWorld_Root', }, - TRANSITION_BETWEEN_APPS: 'TransitionBetweenApps', SIGN_IN_WITH_APPLE_DESKTOP: 'AppleSignInDesktop', SIGN_IN_WITH_GOOGLE_DESKTOP: 'GoogleSignInDesktop', DESKTOP_SIGN_IN_REDIRECT: 'DesktopSignInRedirect', - VALIDATE_LOGIN: 'ValidateLogin', + SAML_SIGN_IN: 'SAMLSignIn', // Iframe screens from olddot HOME_OLDDOT: 'Home_OLDDOT', @@ -44,5 +41,3 @@ export default { GROUPS_WORKSPACES_OLDDOT: 'GroupWorkspaces_OLDDOT', CARDS_AND_DOMAINS_OLDDOT: 'CardsAndDomains_OLDDOT', } as const; - -export {PROTECTED_SCREENS}; diff --git a/src/libs/Navigation/Navigation.js b/src/libs/Navigation/Navigation.js index 07b12486b8b21..503d9fc8251a3 100644 --- a/src/libs/Navigation/Navigation.js +++ b/src/libs/Navigation/Navigation.js @@ -12,7 +12,7 @@ import originalGetTopmostReportId from './getTopmostReportId'; import originalGetTopMostCentralPaneRouteName from './getTopMostCentralPaneRouteName'; import originalGetTopmostReportActionId from './getTopmostReportActionID'; import getStateFromPath from './getStateFromPath'; -import SCREENS, {PROTECTED_SCREENS} from '../../SCREENS'; +import SCREENS from '../../SCREENS'; import CONST from '../../CONST'; let resolveNavigationIsReadyPromise; @@ -262,61 +262,6 @@ function setIsNavigationReady() { resolveNavigationIsReadyPromise(); } -/** - * Checks if the navigation state contains routes that are protected (over the auth wall). - * - * @function - * @param {Object} state - react-navigation state object - * - * @returns {Boolean} - */ -function navContainsProtectedRoutes(state) { - if (!state || !state.routeNames || !_.isArray(state.routeNames)) { - return false; - } - const protectedScreensNames = _.values(PROTECTED_SCREENS); - const difference = _.difference(protectedScreensNames, state.routeNames); - - return !difference.length; -} - -/** - * Waits for the navigation state to contain protected routes specified in PROTECTED_SCREENS constant - * If the navigation is in a state, where protected routes are available, the promise will resolve immediately. - * - * @function - * @returns {Promise} A promise that resolves to `true` when the Concierge route is present. - * Rejects with an error if the navigation is not ready. - * - * @example - * waitForProtectedRoutes() - * .then(() => console.log('Protected routes are present!')) - * .catch(error => console.error(error.message)); - */ -function waitForProtectedRoutes() { - return new Promise((resolve, reject) => { - const isReady = navigationRef.current && navigationRef.current.isReady(); - if (!isReady) { - reject(new Error('[Navigation] is not ready yet!')); - return; - } - const currentState = navigationRef.current.getState(); - if (navContainsProtectedRoutes(currentState)) { - resolve(); - return; - } - let unsubscribe; - const handleStateChange = ({data}) => { - const state = lodashGet(data, 'state'); - if (navContainsProtectedRoutes(state)) { - unsubscribe(); - resolve(); - } - }; - unsubscribe = navigationRef.current.addListener('state', handleStateChange); - }); -} - export default { setShouldPopAllStateOnUP, canNavigate, @@ -330,7 +275,6 @@ export default { setIsNavigationReady, getTopmostReportId, getRouteNameFromStateEvent, - waitForProtectedRoutes, getTopMostCentralPaneRouteName, getTopmostReportActionId, }; diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index c56e9c5677450..af1b4a0ac1dde 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1889,6 +1889,7 @@ function toggleEmojiReaction(reportID, reportAction, reactionObject, existingRea * @param {Boolean} isAuthenticated */ function openReportFromDeepLink(url, isAuthenticated) { + const route = ReportUtils.getRouteFromLink(url); const reportID = ReportUtils.getReportIDFromLink(url); if (reportID && !isAuthenticated) { @@ -1907,16 +1908,11 @@ function openReportFromDeepLink(url, isAuthenticated) { // Navigate to the report after sign-in/sign-up. InteractionManager.runAfterInteractions(() => { Session.waitForUserSignIn().then(() => { - Navigation.waitForProtectedRoutes() - .then(() => { - const route = ReportUtils.getRouteFromLink(url); - if (route === ROUTES.CONCIERGE) { - navigateToConciergeChat(true); - return; - } - Navigation.navigate(route, CONST.NAVIGATION.TYPE.PUSH); - }) - .catch((error) => Log.warn(error.message)); + if (route === ROUTES.CONCIERGE) { + navigateToConciergeChat(true); + return; + } + Navigation.navigate(route, CONST.NAVIGATION.TYPE.PUSH); }); }); }