fix: spinner loading infinitely on unsupported file types (#1002)

This commit is contained in:
Aman Harwara
2022-04-26 19:56:26 +05:30
committed by GitHub
parent 9a99cc8df2
commit 93fbfffbd2

View File

@@ -50,6 +50,10 @@ export const FilePreviewModal: FunctionComponent<Props> = ({ application, file,
const isPreviewable = isFileTypePreviewable(file.mimeType)
setIsFilePreviewable(isPreviewable)
if (!isPreviewable) {
setIsLoadingFile(false)
}
if (!objectUrl && isPreviewable) {
getObjectUrl().catch(console.error)
}