Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,18 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr

// eslint-disable-next-line rulesdir/no-negated-variables
const shouldShowNotFoundPage = useMemo((): boolean => {
const isLoading = isLoadingApp !== false || !!isLoadingReportData || !!reportMetadata?.isLoadingInitialReportActions;
const reportExists = !!reportID || !!isOptimisticDelete || !!userLeavingStatus;
const isInvalidReportPath = !!currentReportIDFormRoute && !isValidReportIDFromPath(currentReportIDFormRoute);
const isLoading = isLoadingApp !== false || isLoadingReportData || !!reportMetadata?.isLoadingInitialReportActions;
const reportExists = !!reportID || isOptimisticDelete || userLeavingStatus;

if (shouldShowNotFoundLinkedAction) {
return true;
}

if (isInvalidReportPath) {
return true;
}

if (isLoading) {
return false;
}
Expand All @@ -539,11 +543,7 @@ function ReportScreen({route, navigation, isInSidePanel = false}: ReportScreenPr
return false;
}

if (!reportExists) {
return true;
}

return isInvalidReportPath;
return !reportExists;
}, [
shouldShowNotFoundLinkedAction,
isLoadingApp,
Expand Down
Loading