diff --git a/android/app/build.gradle b/android/app/build.gradle index 1630538e4b8e..e46080882adc 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -106,8 +106,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001032802 - versionName "1.3.28-2" + versionCode 1001032803 + versionName "1.3.28-3" } splits { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index f3a960f1a98c..ec7a607d6881 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -32,7 +32,7 @@ CFBundleVersion - 1.3.28.2 + 1.3.28.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index a2b4783ca4dd..2e332d335ec5 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.3.28.2 + 1.3.28.3 diff --git a/package-lock.json b/package-lock.json index 7d460c18d812..d6ee58ed16bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.3.28-2", + "version": "1.3.28-3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.3.28-2", + "version": "1.3.28-3", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index a7b899d37204..20703ad2b793 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.3.28-2", + "version": "1.3.28-3", "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/Navigation/Navigation.js b/src/libs/Navigation/Navigation.js index d61eb7143de0..952faaf9a6b7 100644 --- a/src/libs/Navigation/Navigation.js +++ b/src/libs/Navigation/Navigation.js @@ -17,11 +17,6 @@ const navigationIsReadyPromise = new Promise((resolve) => { resolveNavigationIsReadyPromise = resolve; }); -let resolveReportScreenIsReadyPromise; -let reportScreenIsReadyPromise = new Promise((resolve) => { - resolveReportScreenIsReadyPromise = resolve; -}); - let pendingRoute = null; /** @@ -219,20 +214,6 @@ function setIsNavigationReady() { resolveNavigationIsReadyPromise(); } -function resetIsReportScreenReadyPromise() { - reportScreenIsReadyPromise = new Promise((resolve) => { - resolveReportScreenIsReadyPromise = resolve; - }); -} - -function isReportScreenReady() { - return reportScreenIsReadyPromise; -} - -function setIsReportScreenIsReady() { - resolveReportScreenIsReadyPromise(); -} - export default { canNavigate, navigate, @@ -244,9 +225,6 @@ export default { isNavigationReady, setIsNavigationReady, getReportIDFromRoute, - resetIsReportScreenReadyPromise, - isReportScreenReady, - setIsReportScreenIsReady, getTopmostReportId, }; diff --git a/src/libs/SidebarUtils.js b/src/libs/SidebarUtils.js index 7da1017f2d9e..eace44054613 100644 --- a/src/libs/SidebarUtils.js +++ b/src/libs/SidebarUtils.js @@ -90,6 +90,26 @@ Onyx.connect({ callback: (val) => (preferredLocale = val || CONST.LOCALES.DEFAULT), }); +let resolveSidebarIsReadyPromise; + +let sidebarIsReadyPromise = new Promise((resolve) => { + resolveSidebarIsReadyPromise = resolve; +}); + +function resetIsSidebarLoadedReadyPromise() { + sidebarIsReadyPromise = new Promise((resolve) => { + resolveSidebarIsReadyPromise = resolve; + }); +} + +function isSidebarLoadedReady() { + return sidebarIsReadyPromise; +} + +function setIsSidebarLoadedReady() { + resolveSidebarIsReadyPromise(); +} + /** * @param {String} reportIDFromRoute * @returns {String[]} An array of reportIDs sorted in the proper order @@ -354,4 +374,7 @@ function getOptionData(reportID) { export default { getOptionData, getOrderedReportIDs, + setIsSidebarLoadedReady, + isSidebarLoadedReady, + resetIsSidebarLoadedReadyPromise, }; diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index cb4376593526..b481eff7d13f 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -23,6 +23,7 @@ import * as CollectionUtils from '../CollectionUtils'; import * as EmojiUtils from '../EmojiUtils'; import * as ErrorUtils from '../ErrorUtils'; import * as Welcome from './Welcome'; +import SidebarUtils from '../SidebarUtils'; let currentUserEmail; let currentUserAccountID; @@ -1593,7 +1594,7 @@ function openReportFromDeepLink(url, isAuthenticated) { // Navigate to the report after sign-in/sign-up. InteractionManager.runAfterInteractions(() => { - Navigation.isReportScreenReady().then(() => { + SidebarUtils.isSidebarLoadedReady().then(() => { if (reportID) { Navigation.navigate(ROUTES.getReportRoute(reportID)); } diff --git a/src/pages/home/ReportScreen.js b/src/pages/home/ReportScreen.js index 652ea5eb5d2c..c18116ce5635 100644 --- a/src/pages/home/ReportScreen.js +++ b/src/pages/home/ReportScreen.js @@ -149,7 +149,6 @@ class ReportScreen extends React.Component { this.fetchReportIfNeeded(); ComposerActions.setShouldShowComposeInput(true); - Navigation.setIsReportScreenIsReady(); } componentDidUpdate(prevProps) { @@ -168,10 +167,10 @@ class ReportScreen extends React.Component { } componentWillUnmount() { - if (this.unsubscribeVisibilityListener) { - this.unsubscribeVisibilityListener(); + if (!this.unsubscribeVisibilityListener) { + return; } - Navigation.resetIsReportScreenReadyPromise(); + this.unsubscribeVisibilityListener(); } /** diff --git a/src/pages/home/sidebar/SidebarLinks.js b/src/pages/home/sidebar/SidebarLinks.js index a072402a4ca3..9b502193d704 100644 --- a/src/pages/home/sidebar/SidebarLinks.js +++ b/src/pages/home/sidebar/SidebarLinks.js @@ -110,9 +110,14 @@ class SidebarLinks extends React.Component { componentDidMount() { App.setSidebarLoaded(); + SidebarUtils.setIsSidebarLoadedReady(); this.isSidebarLoaded = true; } + componentWillUnmount() { + SidebarUtils.resetIsSidebarLoadedReadyPromise(); + } + showSearchPage() { if (this.props.isCreateMenuOpen) { // Prevent opening Search page when click Search icon quickly after clicking FAB icon