From 12a98b7f59b7a9c739844696f36833295f6aeb5b Mon Sep 17 00:00:00 2001 From: Brendan Campbell-Hartzell <50385408+b-camphart@users.noreply.github.com> Date: Sat, 2 Mar 2024 23:31:34 -0800 Subject: [PATCH] Fis: missing parent in store-vault-sync file adapters --- src/model/store-vault-sync.ts | 4 +++- src/utils/VaultDirectory.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/model/store-vault-sync.ts b/src/model/store-vault-sync.ts index 9f03e7b..9003cdf 100644 --- a/src/model/store-vault-sync.ts +++ b/src/model/store-vault-sync.ts @@ -22,7 +22,7 @@ import { import { fileNameFromPath } from "./note-utils"; import { findScene, sceneFolderPath } from "./scene-navigation"; import { draftForNote, possibleDraftFileCreated } from "./draft"; -import { VaultDirectory } from "src/utils/VaultDirectory"; +import { TFolderDirectory, VaultDirectory } from "src/utils/VaultDirectory"; import type { Note } from "./file-system"; type FileWithMetadata = { @@ -129,6 +129,7 @@ export class StoreVaultSync { { path: file.path, name: file.name, + parent: new TFolderDirectory(this.app, file.parent), getMetadata: () => cache, modifyFrontMatter: (transform) => this.app.fileManager.processFrontMatter(file, transform), @@ -333,6 +334,7 @@ export class StoreVaultSync { return draftForNote(new VaultDirectory(this.app), { path: file.file.path, name: file.file.name, + parent: new TFolderDirectory(this.app, file.file.parent), getMetadata: () => file.metadata, modifyFrontMatter: (transform) => this.app.fileManager.processFrontMatter(file.file, transform), diff --git a/src/utils/VaultDirectory.ts b/src/utils/VaultDirectory.ts index 2634a3a..e3b5931 100644 --- a/src/utils/VaultDirectory.ts +++ b/src/utils/VaultDirectory.ts @@ -109,7 +109,7 @@ class TFileNote implements Note { } } -class TFolderDirectory implements Directory { +export class TFolderDirectory implements Directory { get isDirectory(): true { return true; }