Skip to content

Commit

Permalink
Update settings object if settings file is changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
joethei committed Feb 16, 2024
1 parent bc59748 commit d85e2ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/TTSServiceImplementation.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,8 @@ export default class TTSPlugin extends Plugin {
async saveSettings(): Promise<void> {
await this.saveData(this.settings);
}

async onExternalSettingsChange() {
await this.loadSettings();
}
}

0 comments on commit d85e2ac

Please sign in to comment.