From 3011bbad82741e78ddbfba556cd3da2eda2b75e6 Mon Sep 17 00:00:00 2001 From: Lost Paul <70213368+LostPaul@users.noreply.github.com> Date: Sat, 21 Jun 2025 11:50:11 +0200 Subject: [PATCH] Update PathSettings.ts --- src/settings/PathSettings.ts | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/settings/PathSettings.ts b/src/settings/PathSettings.ts index d6b45b2..7bf3e14 100644 --- a/src/settings/PathSettings.ts +++ b/src/settings/PathSettings.ts @@ -39,22 +39,24 @@ export async function renderPath(settingsTab: SettingsTab) { }) ); - new Setting(containerEl) - .setName('Auto update folder name in the path (front matter title plugin only)') - .setDesc('Automatically update the folder name in the path when the front matter title plugin is enabled and the title for a folder note is changed in the front matter. This will not change the file name, only the displayed name in the path.') - .addToggle((toggle) => - toggle - .setValue(settingsTab.plugin.settings.frontMatterTitle.path) - .onChange(async (value) => { - settingsTab.plugin.settings.frontMatterTitle.path = value; - await settingsTab.plugin.saveSettings(); - if (value) { - settingsTab.plugin.updateAllBreadcrumbs(); - } else { - settingsTab.plugin.updateAllBreadcrumbs(true); - } - }) - ); + if (settingsTab.plugin.settings.frontMatterTitle.enabled) { + new Setting(containerEl) + .setName('Auto update folder name in the path (front matter title plugin only)') + .setDesc('Automatically update the folder name in the path when the front matter title plugin is enabled and the title for a folder note is changed in the front matter. This will not change the file name, only the displayed name in the path.') + .addToggle((toggle) => + toggle + .setValue(settingsTab.plugin.settings.frontMatterTitle.path) + .onChange(async (value) => { + settingsTab.plugin.settings.frontMatterTitle.path = value; + await settingsTab.plugin.saveSettings(); + if (value) { + settingsTab.plugin.updateAllBreadcrumbs(); + } else { + settingsTab.plugin.updateAllBreadcrumbs(true); + } + }) + ); + } settingsTab.settingsPage.createEl('h3', { text: 'Style settings' });