Skip to content

Commit

Permalink
fix: spinner loading infinitely on unsupported file types (#1002)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara authored Apr 26, 2022
1 parent 9a99cc8 commit 93fbfff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/Components/Files/FilePreviewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 93fbfff

Please sign in to comment.