fix: switching between previewable & non-previewable files (#1021)
This commit is contained in:
@@ -210,10 +210,15 @@ export const AttachedFilesButton: FunctionComponent<Props> = observer(
|
||||
case PopoverFileItemActionType.RenameFile:
|
||||
await renameFile(file, action.payload.name)
|
||||
break
|
||||
case PopoverFileItemActionType.PreviewFile:
|
||||
case PopoverFileItemActionType.PreviewFile: {
|
||||
keepMenuOpen(true)
|
||||
appState.filePreviewModal.activate(file, currentTab === PopoverTabs.AllFiles ? allFiles : attachedFiles)
|
||||
const otherFiles = currentTab === PopoverTabs.AllFiles ? allFiles : attachedFiles
|
||||
appState.filePreviewModal.activate(
|
||||
file,
|
||||
otherFiles.filter((file) => !file.protected),
|
||||
)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
|
||||
@@ -69,6 +69,7 @@ export const FilePreviewModal: FunctionComponent<Props> = observer(({ applicatio
|
||||
setIsFilePreviewable(isPreviewable)
|
||||
|
||||
if (!isPreviewable) {
|
||||
setObjectUrl('')
|
||||
setIsLoadingFile(false)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user