Skip to content

Commit

Permalink
Merge pull request Expensify#38804 from dragnoir/38550-fix
Browse files Browse the repository at this point in the history
Fix: load report details when refreshing the page on request confirma…
  • Loading branch information
cristipaval authored Mar 26, 2024
2 parents e243425 + a38370f commit 9cccc36
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,9 @@ Onyx.connect({
});

const policyExpenseReports: OnyxCollection<Report> = {};
const allReports: OnyxCollection<Report> = {};
Onyx.connect({
key: ONYXKEYS.COLLECTION.REPORT,
callback: (report, key) => {
allReports[key] = report;
if (!ReportUtils.isPolicyExpenseChat(report)) {
return;
}
Expand Down Expand Up @@ -741,12 +739,12 @@ function createOption(
* Get the option for a given report.
*/
function getReportOption(participant: Participant): ReportUtils.OptionData {
const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${participant.reportID}`];
const report = ReportUtils.getReport(participant.reportID);

const option = createOption(
report?.visibleChatMemberAccountIDs ?? [],
allPersonalDetails ?? {},
report ?? null,
!isEmptyObject(report) ? report : null,
{},
{
showChatPreviewLine: false,
Expand Down

0 comments on commit 9cccc36

Please sign in to comment.