diff --git a/src/TTSServiceImplementation.ts b/src/TTSServiceImplementation.ts index e31f4ac..beb5108 100644 --- a/src/TTSServiceImplementation.ts +++ b/src/TTSServiceImplementation.ts @@ -1,4 +1,4 @@ -import {MarkdownView, Notice, parseYaml, setIcon, TFile} from "obsidian"; +import {MarkdownView, Notice, parseYaml} from "obsidian"; import {LanguageVoiceMap} from "./settings"; import TTSPlugin from "./main"; import {detect} from "tinyld"; @@ -138,7 +138,6 @@ export class TTSServiceImplementation implements TTSService { } getLanguageFromFrontmatter(view: MarkdownView): string { - view. let language = ""; //check if any language is defined in frontmatter if (!view.getViewData().startsWith("---")) return language; diff --git a/src/main.ts b/src/main.ts index 0017aeb..2e3161b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -227,4 +227,8 @@ export default class TTSPlugin extends Plugin { async saveSettings(): Promise { await this.saveData(this.settings); } + + async onExternalSettingsChange() { + await this.loadSettings(); + } }