From db782d926862dd5b50d42b1809c15eadbe48a47e Mon Sep 17 00:00:00 2001 From: Vit Horacek <36083550+mountiny@users.noreply.github.com> Date: Mon, 25 Nov 2024 19:42:14 +0100 Subject: [PATCH] Merge pull request #53064 from bernhardoj/fix/not-found-when-linking-to-comment [CP Staging] Fix not found view when linking to a message (cherry picked from commit cfaec15080ed9f724022bac937e54bef73b6c86d) (CP triggered by mountiny) --- src/libs/actions/IOU.ts | 8 ++++++++ src/libs/actions/Policy/Policy.ts | 2 ++ src/libs/actions/TeachersUnite.ts | 1 + src/pages/home/ReportScreen.tsx | 2 +- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 96400e1b8f43..68593573ac50 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -6125,6 +6125,7 @@ function getSendMoneyParams( key: `${ONYXKEYS.COLLECTION.REPORT}${optimisticTransactionThread.reportID}`, value: { participants: redundantParticipants, + isOptimisticReport: false, }, }, { @@ -6141,6 +6142,13 @@ function getSendMoneyParams( key: `${ONYXKEYS.COLLECTION.TRANSACTION}${optimisticTransaction.transactionID}`, value: {pendingAction: null}, }, + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}${chatReport.reportID}`, + value: { + isOptimisticReport: false, + }, + }, { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${chatReport.reportID}`, diff --git a/src/libs/actions/Policy/Policy.ts b/src/libs/actions/Policy/Policy.ts index 628e0918aa54..0b72d2de3f98 100644 --- a/src/libs/actions/Policy/Policy.ts +++ b/src/libs/actions/Policy/Policy.ts @@ -2311,6 +2311,7 @@ function createWorkspaceFromIOUPayment(iouReport: OnyxEntry): WorkspaceF addWorkspaceRoom: null, }, pendingAction: null, + isOptimisticReport: false, }, }, { @@ -2330,6 +2331,7 @@ function createWorkspaceFromIOUPayment(iouReport: OnyxEntry): WorkspaceF addWorkspaceRoom: null, }, pendingAction: null, + isOptimisticReport: false, }, }, { diff --git a/src/libs/actions/TeachersUnite.ts b/src/libs/actions/TeachersUnite.ts index bec4906f8cfe..804af75647de 100644 --- a/src/libs/actions/TeachersUnite.ts +++ b/src/libs/actions/TeachersUnite.ts @@ -137,6 +137,7 @@ function addSchoolPrincipal(firstName: string, partnerUserID: string, lastName: pendingFields: { addWorkspaceRoom: null, }, + isOptimisticReport: false, pendingAction: null, }, }, diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 6d24941e2f75..c8884dc75374 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -515,7 +515,7 @@ function ReportScreen({route, currentReportID = '', navigation}: ReportScreenPro // This function is triggered when a user clicks on a link to navigate to a report. // For each link click, we retrieve the report data again, even though it may already be cached. // There should be only one openReport execution per page start or navigating - fetchReportIfNeeded(); + fetchReport(); // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps }, [route, isLinkedMessagePageReady, isLoadingReportOnyx, reportActionIDFromRoute]);