diff --git a/src/settings/PathSettings.ts b/src/settings/PathSettings.ts index 7bf3e14..eb8499f 100644 --- a/src/settings/PathSettings.ts +++ b/src/settings/PathSettings.ts @@ -15,29 +15,31 @@ export async function renderPath(settingsTab: SettingsTab) { }) ); - new Setting(containerEl) - .setName('Open sidebar when opening a folder note through path (Mobile only)') - .setDesc('Open the sidebar when opening a folder note through the path on mobile') - .addToggle((toggle) => - toggle - .setValue(settingsTab.plugin.settings.openSidebar.mobile) - .onChange(async (value) => { - settingsTab.plugin.settings.openSidebar.mobile = value; - await settingsTab.plugin.saveSettings(); - }) - ); + if (settingsTab.plugin.settings.openFolderNoteOnClickInPath) { + new Setting(containerEl) + .setName('Open sidebar when opening a folder note through path (Mobile only)') + .setDesc('Open the sidebar when opening a folder note through the path on mobile') + .addToggle((toggle) => + toggle + .setValue(settingsTab.plugin.settings.openSidebar.mobile) + .onChange(async (value) => { + settingsTab.plugin.settings.openSidebar.mobile = value; + await settingsTab.plugin.saveSettings(); + }) + ); - new Setting(containerEl) - .setName('Open sidebar when opening a folder note through path (Desktop only)') - .setDesc('Open the sidebar when opening a folder note through the path on desktop') - .addToggle((toggle) => - toggle - .setValue(settingsTab.plugin.settings.openSidebar.desktop) - .onChange(async (value) => { - settingsTab.plugin.settings.openSidebar.desktop = value; - await settingsTab.plugin.saveSettings(); - }) - ); + new Setting(containerEl) + .setName('Open sidebar when opening a folder note through path (Desktop only)') + .setDesc('Open the sidebar when opening a folder note through the path on desktop') + .addToggle((toggle) => + toggle + .setValue(settingsTab.plugin.settings.openSidebar.desktop) + .onChange(async (value) => { + settingsTab.plugin.settings.openSidebar.desktop = value; + await settingsTab.plugin.saveSettings(); + }) + ); + } if (settingsTab.plugin.settings.frontMatterTitle.enabled) { new Setting(containerEl)