From 016df60dbe6bf7e340cbe5823e2af33d15dd55c9 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 12 Apr 2024 09:57:24 +0700 Subject: [PATCH 1/2] fix: Blank page after returning to IOU report from thread and deleting the other request --- src/pages/home/ReportScreen.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index b93daf4f097b..3bf2392eb444 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -333,6 +333,13 @@ function ReportScreen({ } const transactionThreadReportID = useMemo(() => ReportActionsUtils.getOneTransactionThreadReportID(report.reportID, reportActions ?? []), [report.reportID, reportActions]); + + useEffect(() => { + if (transactionThreadReportID && route.params.reportActionID) { + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route.params.reportID)); + } + }, [transactionThreadReportID]); + if (ReportUtils.isMoneyRequestReport(report)) { headerView = ( Date: Fri, 12 Apr 2024 10:27:17 +0700 Subject: [PATCH 2/2] lint fix --- src/pages/home/ReportScreen.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/home/ReportScreen.tsx b/src/pages/home/ReportScreen.tsx index 3bf2392eb444..68f984d31414 100644 --- a/src/pages/home/ReportScreen.tsx +++ b/src/pages/home/ReportScreen.tsx @@ -335,10 +335,11 @@ function ReportScreen({ const transactionThreadReportID = useMemo(() => ReportActionsUtils.getOneTransactionThreadReportID(report.reportID, reportActions ?? []), [report.reportID, reportActions]); useEffect(() => { - if (transactionThreadReportID && route.params.reportActionID) { - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route.params.reportID)); + if (!transactionThreadReportID || !route.params.reportActionID) { + return; } - }, [transactionThreadReportID]); + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route.params.reportID)); + }, [transactionThreadReportID, route.params.reportActionID, route.params.reportID]); if (ReportUtils.isMoneyRequestReport(report)) { headerView = (