Skip to content

Commit b1211db

Browse files
authored
Merge pull request #10561 from Expensify/OSBotify-cherry-pick-staging-10545
🍒 Cherry pick PR #10545 to staging 🍒
2 parents 5eb4f0d + 6f3d3f6 commit b1211db

File tree

7 files changed

+23
-16
lines changed

7 files changed

+23
-16
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ android {
155155
minSdkVersion rootProject.ext.minSdkVersion
156156
targetSdkVersion rootProject.ext.targetSdkVersion
157157
multiDexEnabled rootProject.ext.multiDexEnabled
158-
versionCode 1001018902
159-
versionName "1.1.89-2"
158+
versionCode 1001018903
159+
versionName "1.1.89-3"
160160
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
161161

162162
if (isNewArchitectureEnabled()) {

ios/NewExpensify/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</dict>
3131
</array>
3232
<key>CFBundleVersion</key>
33-
<string>1.1.89.2</string>
33+
<string>1.1.89.3</string>
3434
<key>ITSAppUsesNonExemptEncryption</key>
3535
<false/>
3636
<key>LSApplicationQueriesSchemes</key>

ios/NewExpensifyTests/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.1.89.2</string>
22+
<string>1.1.89.3</string>
2323
</dict>
2424
</plist>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new.expensify",
3-
"version": "1.1.89-2",
3+
"version": "1.1.89-3",
44
"author": "Expensify, Inc.",
55
"homepage": "https://new.expensify.com",
66
"description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",

src/pages/home/ReportScreen.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ const propTypes = {
6161

6262
/** Flag to check if the report actions data are loading */
6363
isLoadingReportActions: PropTypes.bool,
64+
65+
/** ID for the report */
66+
reportID: PropTypes.string,
6467
}),
6568

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

171174
/**
172175
* Persists the currently viewed report id
173176
*/
174177
storeCurrentlyViewedReport() {
175-
const reportID = getReportID(this.props.route);
176-
if (_.isNaN(reportID)) {
178+
const reportIDFromPath = getReportID(this.props.route);
179+
if (_.isNaN(reportIDFromPath)) {
177180
Report.handleInaccessibleReport();
178181
return;
179182
}
180183

181184
// Always reset the state of the composer view when the current reportID changes
182185
toggleReportActionComposeView(true);
183-
Report.updateCurrentlyViewedReportID(reportID);
186+
Report.updateCurrentlyViewedReportID(reportIDFromPath);
187+
188+
// 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
189+
// is not stored locally yet. If props.report.reportID exists, then the report has been stored locally and nothing more needs to be done.
190+
// If it doesn't exist, then we fetch the report from the API.
191+
if (this.props.report.reportID) {
192+
return;
193+
}
194+
195+
Report.fetchChatReportsByIDs([reportIDFromPath], true);
184196
}
185197

186198
/**

src/pages/home/report/ReportActionsView.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ class ReportActionsView extends React.Component {
115115
Report.openReport(this.props.report.reportID);
116116
});
117117

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

0 commit comments

Comments
 (0)