diff --git a/apps/native/app/src/screens/document-detail/document-detail.tsx b/apps/native/app/src/screens/document-detail/document-detail.tsx index 6b913a98a79a..c74b37ce9a31 100644 --- a/apps/native/app/src/screens/document-detail/document-detail.tsx +++ b/apps/native/app/src/screens/document-detail/document-detail.tsx @@ -315,10 +315,10 @@ export const DocumentDetailScreen: NavigationFunctionComponent<{ const hasConfirmation = !!Document.confirmation const hasAlert = !!Document.alert && (Document.alert?.title || Document.alert?.data) - const showAlert = + const showAdditionalInfo = showConfirmedAlert || (hasAlert && !hasConfirmation) || - (hasActions && !showConfirmationAlert) + (hasActions && !showConfirmedAlert && !hasConfirmation) const loading = docRes.loading || !accessToken const fileTypeLoaded = !!Document?.content?.type @@ -438,7 +438,7 @@ export const DocumentDetailScreen: NavigationFunctionComponent<{ label={isUrgent ? intl.formatMessage({ id: 'inbox.urgent' }) : ''} /> - {showAlert && ( + {showAdditionalInfo && ( {showConfirmedAlert && ( ) : hasPdf ? ( - {visible && - accessToken && - (shouldIncludeDocument || - (!shouldIncludeDocument && showAlert)) && ( - { - setPdfUrl(filePath) - // Make sure to not set document as loaded until actions have been fetched - // To prevent top of first page not being shown - if (shouldIncludeDocument) { - setLoaded(true) - } - }} - onError={() => { + {visible && accessToken && loaded && ( + { + setPdfUrl(filePath) + // Make sure to not set document as loaded until actions have been fetched + // To prevent top of first page not being shown + if (shouldIncludeDocument) { setLoaded(true) - setError(true) - }} - /> - )} + } + }} + onError={() => { + setLoaded(true) + setError(true) + }} + /> + )} ) : (