-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix page not found appears for a second when user opens a thread #20076
Changes from all commits
ff8e3b9
e4ef1de
cbe74ba
ba1e2dc
da20600
5a85f7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,6 +380,16 @@ function openReport(reportID, participantList = [], newReportObject = {}, parent | |
params.shouldRetry = false; | ||
} | ||
|
||
// If we open an exist report, but it is not present in Onyx yet, we should change the method to set for this report | ||
// and we need data to be available when we navigate to the chat page | ||
if (_.isEmpty(ReportUtils.getReport(reportID))) { | ||
optimisticReportData.onyxMethod = Onyx.METHOD.SET; | ||
optimisticReportData.value = { | ||
...optimisticReportData.value, | ||
reportID: reportID.toString(), | ||
}; | ||
} | ||
Comment on lines
+385
to
+391
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Investigating now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aldo-expensify It looks like setting the |
||
|
||
// If we are creating a new report, we need to add the optimistic report data and a report action | ||
if (!_.isEmpty(newReportObject)) { | ||
// Change the method to set for new reports because it doesn't exist yet, is faster, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also causing crash if user is not authenticated yet, and does not have any value in onyx. Part of #20394
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch @alitoshmatov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this can still return null if the report key is present, but the report was deleted (set to null)