Skip to content

Commit

Permalink
fixing an issue where the configuration is not saved after changing a…
Browse files Browse the repository at this point in the history
… voice.
  • Loading branch information
joethei committed Dec 22, 2021
1 parent 29972a9 commit 97eea00
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-tts",
"name": "Text to Speech",
"version": "0.3.4",
"version": "0.3.5",
"minAppVersion": "0.12.0",
"description": "Text to speech for Obsidian. Hear your notes.",
"author": "Johannes Theiner",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-tts",
"version": "0.3.4",
"version": "0.3.5",
"description": "Text to speech for Obsidian. Hear your notes.",
"main": "main.js",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ export class TTSSettingsTab extends PluginSettingTab {

modal.onClose = async () => {
if (modal.saved) {
const setting = this.plugin.settings.languageVoices.filter(value => value.language !== modal.language);
setting.push({language: modal.language, voice: modal.voice});
this.plugin.settings.languageVoices = setting;
await this.plugin.saveSettings();

this.display();
}
};
Expand All @@ -140,6 +145,8 @@ export class TTSSettingsTab extends PluginSettingTab {
b.setIcon("trash")
.setTooltip("Delete")
.onClick(async () => {
this.plugin.settings.languageVoices = this.plugin.settings.languageVoices.filter(value => value.language !== languageVoice.language);
await this.plugin.saveSettings();

this.display();
});
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"0.2.0": "0.9.12",
"0.3.2": "0.12.0",
"0.3.3": "0.12.0",
"0.3.4": "0.12.0"
"0.3.4": "0.12.0",
"0.3.5": "0.12.0"
}

0 comments on commit 97eea00

Please sign in to comment.