refactor: add redundant protection checks (#1822)
This commit is contained in:
@@ -57,6 +57,10 @@ const FilePreview = ({ file, application }: Props) => {
|
||||
void downloadFileForPreview()
|
||||
}, [application.files, downloadedBytes, file, isFilePreviewable])
|
||||
|
||||
if (!application.isAuthorizedToRenderItem(file)) {
|
||||
return null
|
||||
}
|
||||
|
||||
return isDownloading ? (
|
||||
<div className="flex flex-grow flex-col items-center justify-center">
|
||||
<div className="flex items-center">
|
||||
|
||||
@@ -22,6 +22,10 @@ const FilePreviewModal: FunctionComponent<Props> = observer(({ application, view
|
||||
return null
|
||||
}
|
||||
|
||||
if (!application.isAuthorizedToRenderItem(currentFile)) {
|
||||
return null
|
||||
}
|
||||
|
||||
const [showFileInfoPanel, setShowFileInfoPanel] = useState(false)
|
||||
const closeButtonRef = useRef<HTMLButtonElement>(null)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user