diff options
Diffstat (limited to 'src/stores/ServicesStore.js')
-rw-r--r-- | src/stores/ServicesStore.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index 48b128966..752f287e8 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -21,7 +21,6 @@ import { workspaceStore } from '../features/workspaces'; | |||
21 | import { serviceLimitStore } from '../features/serviceLimit'; | 21 | import { serviceLimitStore } from '../features/serviceLimit'; |
22 | import { RESTRICTION_TYPES } from '../models/Service'; | 22 | import { RESTRICTION_TYPES } from '../models/Service'; |
23 | import { KEEP_WS_LOADED_USID } from '../config'; | 23 | import { KEEP_WS_LOADED_USID } from '../config'; |
24 | import { TODOS_RECIPE_ID } from '../features/todos'; | ||
25 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; | 24 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; |
26 | 25 | ||
27 | const debug = require('debug')('Ferdi:ServiceStore'); | 26 | const debug = require('debug')('Ferdi:ServiceStore'); |
@@ -279,11 +278,11 @@ export default class ServicesStore extends Store { | |||
279 | } | 278 | } |
280 | 279 | ||
281 | @computed get isTodosServiceAdded() { | 280 | @computed get isTodosServiceAdded() { |
282 | return this.allDisplayed.find(service => service.recipe.id === TODOS_RECIPE_ID && service.isEnabled) || null; | 281 | return this.allDisplayed.find(service => service.isTodosService && service.isEnabled) || false; |
283 | } | 282 | } |
284 | 283 | ||
285 | @computed get isTodosServiceActive() { | 284 | @computed get isTodosServiceActive() { |
286 | return this.active && this.active.recipe.id === TODOS_RECIPE_ID; | 285 | return this.active && this.active.isTodosService; |
287 | } | 286 | } |
288 | 287 | ||
289 | one(id) { | 288 | one(id) { |
@@ -484,7 +483,7 @@ export default class ServicesStore extends Store { | |||
484 | this._awake({ serviceId: service.id }); | 483 | this._awake({ serviceId: service.id }); |
485 | service.lastUsed = Date.now(); | 484 | service.lastUsed = Date.now(); |
486 | 485 | ||
487 | if (this.active.recipe.id === TODOS_RECIPE_ID && !this.stores.todos.settings.isFeatureEnabledByUser) { | 486 | if (this.isTodosServiceActive && !this.stores.todos.settings.isFeatureEnabledByUser) { |
488 | this.actions.todos.toggleTodosFeatureVisibility(); | 487 | this.actions.todos.toggleTodosFeatureVisibility(); |
489 | } | 488 | } |
490 | 489 | ||
@@ -718,7 +717,7 @@ export default class ServicesStore extends Store { | |||
718 | service.resetMessageCount(); | 717 | service.resetMessageCount(); |
719 | service.lostRecipeConnection = false; | 718 | service.lostRecipeConnection = false; |
720 | 719 | ||
721 | if (service.recipe.id === TODOS_RECIPE_ID) { | 720 | if (service.isTodosService) { |
722 | return this.actions.todos.reload(); | 721 | return this.actions.todos.reload(); |
723 | } | 722 | } |
724 | 723 | ||
@@ -805,7 +804,7 @@ export default class ServicesStore extends Store { | |||
805 | 804 | ||
806 | @action _openDevTools({ serviceId }) { | 805 | @action _openDevTools({ serviceId }) { |
807 | const service = this.one(serviceId); | 806 | const service = this.one(serviceId); |
808 | if (service.recipe.id === TODOS_RECIPE_ID) { | 807 | if (service.isTodosService) { |
809 | this.actions.todos.openDevTools(); | 808 | this.actions.todos.openDevTools(); |
810 | } else { | 809 | } else { |
811 | service.webview.openDevTools(); | 810 | service.webview.openDevTools(); |