Skip to content

Commit 9e039e8

Browse files
authored
Merge pull request Expensify#78977 from dmkt9/fix/74125b
Fix/74125 - Details report page is not scrollable
2 parents dd5bd5d + ae8bb8d commit 9e039e8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/pages/home/ReportScreen.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,15 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
591591

592592
const prevTransactionThreadReportID = usePrevious(transactionThreadReportID);
593593
useEffect(() => {
594-
if (!!prevTransactionThreadReportID || !transactionThreadReportID) {
594+
// If transactionThreadReportID is undefined or CONST.FAKE_REPORT_ID, we do not call fetchReport.
595+
// Only when transactionThreadReportID changes to a valid value, the fetchReport will be called to fetch the data again for the current report.
596+
// Since fetchReport is always called once when opening a report,
597+
// if that initial call is used to create a transactionThreadReport,
598+
// then fetchReport needs to be called again after the transactionThreadReport has been fully created.
599+
const prevTransactionThreadReportIDWasValid = !!prevTransactionThreadReportID && prevTransactionThreadReportID !== CONST.FAKE_REPORT_ID;
600+
const transactionThreadReportIDUpdatedFromValidToFake = transactionThreadReportID === CONST.FAKE_REPORT_ID && !!prevTransactionThreadReportID;
601+
602+
if (prevTransactionThreadReportIDWasValid || !transactionThreadReportID || transactionThreadReportIDUpdatedFromValidToFake) {
595603
return;
596604
}
597605

0 commit comments

Comments
 (0)