Skip to content

Commit

Permalink
fix not found flash after loading app
Browse files Browse the repository at this point in the history
  • Loading branch information
arosiclair committed Jun 19, 2024
1 parent 63061d9 commit f625844
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,12 @@ function ReportScreen({
return false;
}

// If we just finished loading the app, we still need to try fetching the report. Wait until that's done before
// showing the Not Found page
if (finishedLoadingApp) {
return false;
}

if (!wasReportAccessibleRef.current && !firstRenderRef.current && !report.reportID && !isOptimisticDelete && !reportMetadata?.isLoadingInitialReportActions && !userLeavingStatus) {
return true;
}
Expand All @@ -408,7 +414,7 @@ function ReportScreen({
}

return !!currentReportIDFormRoute && !ReportUtils.isValidReportIDFromPath(currentReportIDFormRoute);
}, [isLoadingApp, report.reportID, isOptimisticDelete, reportMetadata?.isLoadingInitialReportActions, userLeavingStatus, shouldHideReport, currentReportIDFormRoute]);
}, [isLoadingApp, finishedLoadingApp, report.reportID, isOptimisticDelete, reportMetadata?.isLoadingInitialReportActions, userLeavingStatus, shouldHideReport, currentReportIDFormRoute]);

const fetchReport = useCallback(() => {
Report.openReport(reportIDFromRoute, reportActionIDFromRoute);
Expand Down

0 comments on commit f625844

Please sign in to comment.