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:
|
case PopoverFileItemActionType.RenameFile:
|
||||||
await renameFile(file, action.payload.name)
|
await renameFile(file, action.payload.name)
|
||||||
break
|
break
|
||||||
case PopoverFileItemActionType.PreviewFile:
|
case PopoverFileItemActionType.PreviewFile: {
|
||||||
keepMenuOpen(true)
|
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
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ export const FilePreviewModal: FunctionComponent<Props> = observer(({ applicatio
|
|||||||
setIsFilePreviewable(isPreviewable)
|
setIsFilePreviewable(isPreviewable)
|
||||||
|
|
||||||
if (!isPreviewable) {
|
if (!isPreviewable) {
|
||||||
|
setObjectUrl('')
|
||||||
setIsLoadingFile(false)
|
setIsLoadingFile(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user