chore: legacy fixes (#2343)
This commit is contained in:
@@ -62,12 +62,12 @@ describe('LinkingController', () => {
|
||||
alerts: {} as jest.Mocked<WebApplication['alerts']>,
|
||||
sync: {} as jest.Mocked<WebApplication['sync']>,
|
||||
mutator: {} as jest.Mocked<WebApplication['mutator']>,
|
||||
itemControllerGroup: {} as jest.Mocked<WebApplication['itemControllerGroup']>,
|
||||
} as unknown as jest.Mocked<WebApplication>
|
||||
|
||||
application.getPreference = jest.fn()
|
||||
application.addSingleEventObserver = jest.fn()
|
||||
application.streamItems = jest.fn()
|
||||
application.itemControllerGroup = {} as jest.Mocked<WebApplication['itemControllerGroup']>
|
||||
application.sync.sync = jest.fn()
|
||||
|
||||
Object.defineProperty(application, 'items', { value: {} as jest.Mocked<ItemManagerInterface> })
|
||||
|
||||
@@ -197,11 +197,13 @@ export class LinkingController extends AbstractViewController {
|
||||
const linkNoteAndFile = async (note: SNNote, file: FileItem) => {
|
||||
const updatedFile = await this.application.mutator.associateFileWithNote(file, note)
|
||||
|
||||
if (updatedFile && featureTrunkVaultsEnabled()) {
|
||||
const noteVault = this.application.vaults.getItemVault(note)
|
||||
const fileVault = this.application.vaults.getItemVault(updatedFile)
|
||||
if (noteVault && !fileVault) {
|
||||
await this.application.vaults.moveItemToVault(noteVault, file)
|
||||
if (featureTrunkVaultsEnabled()) {
|
||||
if (updatedFile) {
|
||||
const noteVault = this.application.vaults.getItemVault(note)
|
||||
const fileVault = this.application.vaults.getItemVault(updatedFile)
|
||||
if (noteVault && !fileVault) {
|
||||
await this.application.vaults.moveItemToVault(noteVault, file)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user