Skip to content

Commit

Permalink
Merge pull request #20795 from Expensify/OSBotify-cherry-pick-staging…
Browse files Browse the repository at this point in the history
…-20740

🍒 Cherry pick PR #20740 to staging 🍒
  • Loading branch information
OSBotify authored Jun 15, 2023
2 parents 0481339 + 650dd03 commit 7ddf35b
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 34 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.28.2</string>
<string>1.3.28.3</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.28.2</string>
<string>1.3.28.3</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand Down
22 changes: 0 additions & 22 deletions src/libs/Navigation/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ const navigationIsReadyPromise = new Promise((resolve) => {
resolveNavigationIsReadyPromise = resolve;
});

let resolveReportScreenIsReadyPromise;
let reportScreenIsReadyPromise = new Promise((resolve) => {
resolveReportScreenIsReadyPromise = resolve;
});

let pendingRoute = null;

/**
Expand Down Expand Up @@ -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,
Expand All @@ -244,9 +225,6 @@ export default {
isNavigationReady,
setIsNavigationReady,
getReportIDFromRoute,
resetIsReportScreenReadyPromise,
isReportScreenReady,
setIsReportScreenIsReady,
getTopmostReportId,
};

Expand Down
23 changes: 23 additions & 0 deletions src/libs/SidebarUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -354,4 +374,7 @@ function getOptionData(reportID) {
export default {
getOptionData,
getOrderedReportIDs,
setIsSidebarLoadedReady,
isSidebarLoadedReady,
resetIsSidebarLoadedReadyPromise,
};
3 changes: 2 additions & 1 deletion src/libs/actions/Report.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
Expand Down
7 changes: 3 additions & 4 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class ReportScreen extends React.Component {

this.fetchReportIfNeeded();
ComposerActions.setShouldShowComposeInput(true);
Navigation.setIsReportScreenIsReady();
}

componentDidUpdate(prevProps) {
Expand All @@ -168,10 +167,10 @@ class ReportScreen extends React.Component {
}

componentWillUnmount() {
if (this.unsubscribeVisibilityListener) {
this.unsubscribeVisibilityListener();
if (!this.unsubscribeVisibilityListener) {
return;
}
Navigation.resetIsReportScreenReadyPromise();
this.unsubscribeVisibilityListener();
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/pages/home/sidebar/SidebarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ddf35b

Please sign in to comment.