fix: issue with not being able to unlink a file from a note (#1836)

This commit is contained in:
Mo
2022-10-19 14:36:30 -05:00
committed by GitHub
parent ba9a9f8d01
commit 4030953b00
10 changed files with 122 additions and 243 deletions

View File

@@ -14,7 +14,14 @@ import {
ClassicFileSaver,
parseFileName,
} from '@standardnotes/filepicker'
import { ChallengeReason, ClientDisplayableError, ContentType, FileItem, InternalEventBus } from '@standardnotes/snjs'
import {
ChallengeReason,
ClientDisplayableError,
ContentType,
FileItem,
InternalEventBus,
isFile,
} from '@standardnotes/snjs'
import { addToast, dismissToast, ToastType, updateToast } from '@standardnotes/toast'
import { action, makeObservable, observable, reaction } from 'mobx'
import { WebApplication } from '../Application/Application'
@@ -99,7 +106,7 @@ export class FilesController extends AbstractViewController {
reloadAttachedFiles = () => {
const note = this.notesController.firstSelectedNote
if (note) {
this.attachedFiles = this.application.items.getSortedFilesLinkingToItem(note)
this.attachedFiles = this.application.items.itemsReferencingItem(note).filter(isFile)
}
}