chore: fix file preview modal vault selection

This commit is contained in:
Aman Harwara
2023-08-09 14:21:43 +05:30
parent eafd624763
commit 03083be626

View File

@@ -24,8 +24,9 @@ export class FilePreviewModalController {
if (!this.currentFile) {
return
}
if (changed.includes(this.currentFile)) {
this.setCurrentFile(this.currentFile)
const changedCurrentFile = changed.find((f) => f.uuid === this.currentFile?.uuid) as FileItem | undefined
if (changedCurrentFile) {
this.setCurrentFile(changedCurrentFile)
}
if (removed.find((f) => f.uuid === this.currentFile?.uuid)) {
if (!this.otherFiles.length) {