diff options
author | 2018-12-08 22:33:58 +0100 | |
---|---|---|
committer | 2018-12-08 22:33:58 +0100 | |
commit | e5c1751c3dc691458ba9e870d4849e4872db2ff1 (patch) | |
tree | 6a1f94eaaf4b2a43e92b58b73eb651ce1fa5f1f9 /src/webview/recipe.js | |
parent | Only show loader on initial service load (diff) | |
download | ferdium-app-e5c1751c3dc691458ba9e870d4849e4872db2ff1.tar.gz ferdium-app-e5c1751c3dc691458ba9e870d4849e4872db2ff1.tar.zst ferdium-app-e5c1751c3dc691458ba9e870d4849e4872db2ff1.zip |
Minor recipe plugin polishing
Diffstat (limited to 'src/webview/recipe.js')
-rw-r--r-- | src/webview/recipe.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/webview/recipe.js b/src/webview/recipe.js index a2c157af8..c9117ac72 100644 --- a/src/webview/recipe.js +++ b/src/webview/recipe.js | |||
@@ -9,13 +9,18 @@ import { injectDarkModeStyle, isDarkModeStyleInjected, removeDarkModeStyle } fro | |||
9 | import contextMenu from './contextMenu'; | 9 | import contextMenu from './contextMenu'; |
10 | import './notifications'; | 10 | import './notifications'; |
11 | 11 | ||
12 | import { DEFAULT_APP_SETTINGS } from '../config'; | ||
13 | |||
12 | const debug = require('debug')('Franz:Plugin'); | 14 | const debug = require('debug')('Franz:Plugin'); |
13 | 15 | ||
14 | class RecipeController { | 16 | class RecipeController { |
15 | @observable settings = { | 17 | @observable settings = { |
16 | overrideSpellcheckerLanguage: false, | 18 | overrideSpellcheckerLanguage: false, |
17 | app: {}, | 19 | app: DEFAULT_APP_SETTINGS, |
18 | service: {}, | 20 | service: { |
21 | isDarkModeEnabled: false, | ||
22 | spellcheckerLanguage: '', | ||
23 | }, | ||
19 | }; | 24 | }; |
20 | 25 | ||
21 | spellcheckProvider = null; | 26 | spellcheckProvider = null; |
@@ -49,6 +54,7 @@ class RecipeController { | |||
49 | this.spellcheckingProvider = await spellchecker(); | 54 | this.spellcheckingProvider = await spellchecker(); |
50 | contextMenu( | 55 | contextMenu( |
51 | this.spellcheckingProvider, | 56 | this.spellcheckingProvider, |
57 | () => this.settings.app.enableSpellchecking, | ||
52 | () => this.settings.app.spellcheckerLanguage, | 58 | () => this.settings.app.spellcheckerLanguage, |
53 | () => this.spellcheckerLanguage); | 59 | () => this.spellcheckerLanguage); |
54 | 60 | ||
@@ -81,10 +87,10 @@ class RecipeController { | |||
81 | debug('Setting spellchecker language to', this.spellcheckerLanguage); | 87 | debug('Setting spellchecker language to', this.spellcheckerLanguage); |
82 | switchDict(this.spellcheckerLanguage); | 88 | switchDict(this.spellcheckerLanguage); |
83 | } else { | 89 | } else { |
90 | debug('Disable spellchecker'); | ||
84 | disableSpellchecker(); | 91 | disableSpellchecker(); |
85 | } | 92 | } |
86 | 93 | ||
87 | console.log(this.settings.service); | ||
88 | if (this.settings.service.isDarkModeEnabled) { | 94 | if (this.settings.service.isDarkModeEnabled) { |
89 | debug('Enable dark mode'); | 95 | debug('Enable dark mode'); |
90 | injectDarkModeStyle(this.settings.service.recipe.path); | 96 | injectDarkModeStyle(this.settings.service.recipe.path); |