aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/spellchecker/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/spellchecker/index.js')
-rw-r--r--src/features/spellchecker/index.js28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/features/spellchecker/index.js b/src/features/spellchecker/index.js
index 8b3fb7e00..8516f816c 100644
--- a/src/features/spellchecker/index.js
+++ b/src/features/spellchecker/index.js
@@ -12,26 +12,24 @@ export default function init(stores) {
12 reaction( 12 reaction(
13 () => stores.features.features.isSpellcheckerPremiumFeature, 13 () => stores.features.features.isSpellcheckerPremiumFeature,
14 (enabled, r) => { 14 (enabled, r) => {
15 if (enabled) { 15 debug('Initializing `spellchecker` feature');
16 debug('Initializing `spellchecker` feature');
17 16
18 // Dispose the reaction to run this only once 17 // Dispose the reaction to run this only once
19 r.dispose(); 18 r.dispose();
20 19
21 const { isSpellcheckerPremiumFeature } = stores.features.features; 20 const { isSpellcheckerPremiumFeature } = stores.features.features;
22 21
23 config.isPremiumFeature = isSpellcheckerPremiumFeature !== undefined ? isSpellcheckerPremiumFeature : DEFAULT_IS_PREMIUM_FEATURE; 22 config.isPremiumFeature = isSpellcheckerPremiumFeature !== undefined ? isSpellcheckerPremiumFeature : DEFAULT_IS_PREMIUM_FEATURE;
24 23
25 autorun(() => { 24 autorun(() => {
26 if (!stores.user.data.isPremium && config.isPremiumFeature) { 25 if (!stores.user.data.isPremium && config.isPremiumFeature) {
27 debug('Override settings.spellcheckerEnabled flag to false'); 26 debug('Override settings.spellcheckerEnabled flag to false');
28 27
29 Object.assign(stores.settings.all.app, { 28 Object.assign(stores.settings.all.app, {
30 enableSpellchecker: false, 29 enableSpellchecker: false,
31 }); 30 });
32 } 31 }
33 }); 32 });
34 }
35 }, 33 },
36 ); 34 );
37} 35}