Skip to content

Commit

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

🍒 Cherry pick PR #10545 to staging 🍒
  • Loading branch information
OSBotify authored Aug 25, 2022
2 parents 5eb4f0d + 6f3d3f6 commit b1211db
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001018902
versionName "1.1.89-2"
versionCode 1001018903
versionName "1.1.89-3"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.1.89.2</string>
<string>1.1.89.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.1.89.2</string>
<string>1.1.89.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.1.89-2",
"version": "1.1.89-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
20 changes: 16 additions & 4 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ const propTypes = {

/** Flag to check if the report actions data are loading */
isLoadingReportActions: PropTypes.bool,

/** ID for the report */
reportID: PropTypes.string,
}),

/** Array of report actions for this report */
Expand Down Expand Up @@ -165,22 +168,31 @@ class ReportScreen extends React.Component {
shouldShowLoader() {
// This means there are no reportActions at all to display, but it is still in the process of loading the next set of actions.
const isLoadingInitialReportActions = _.isEmpty(this.props.reportActions) && this.props.report.isLoadingReportActions;
return !getReportID(this.props.route) || isLoadingInitialReportActions;
return !getReportID(this.props.route) || isLoadingInitialReportActions || !this.props.report.reportID;
}

/**
* Persists the currently viewed report id
*/
storeCurrentlyViewedReport() {
const reportID = getReportID(this.props.route);
if (_.isNaN(reportID)) {
const reportIDFromPath = getReportID(this.props.route);
if (_.isNaN(reportIDFromPath)) {
Report.handleInaccessibleReport();
return;
}

// Always reset the state of the composer view when the current reportID changes
toggleReportActionComposeView(true);
Report.updateCurrentlyViewedReportID(reportID);
Report.updateCurrentlyViewedReportID(reportIDFromPath);

// It possible that we may not have the report object yet in Onyx yet e.g. we navigated to a URL for an accessible report that
// is not stored locally yet. If props.report.reportID exists, then the report has been stored locally and nothing more needs to be done.
// If it doesn't exist, then we fetch the report from the API.
if (this.props.report.reportID) {
return;
}

Report.fetchChatReportsByIDs([reportIDFromPath], true);
}

/**
Expand Down
5 changes: 0 additions & 5 deletions src/pages/home/report/ReportActionsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ class ReportActionsView extends React.Component {
Report.openReport(this.props.report.reportID);
});

// If the reportID is not found then we have either not loaded this chat or the user is unable to access it.
// We will attempt to fetch it and redirect if still not accessible.
if (!this.props.report.reportID) {
Report.fetchChatReportsByIDs([this.props.report.reportID], true);
}
Report.subscribeToReportTypingEvents(this.props.report.reportID);
this.keyboardEvent = Keyboard.addListener('keyboardDidShow', () => {
if (!ReportActionComposeFocusManager.isFocused()) {
Expand Down

0 comments on commit b1211db

Please sign in to comment.