diff options
author | Abin Mn <abinmn619@gmail.com> | 2021-10-26 21:18:20 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 21:18:20 +0530 |
commit | 91c69428ed0dc2dd26b00c6dd5a6684f25515a34 (patch) | |
tree | 062a9a4946aa1367263533682ee59e795ea97234 /src/features/todos | |
parent | Add feature to display service name under service icon when the toggle for it... (diff) | |
download | ferdium-app-91c69428ed0dc2dd26b00c6dd5a6684f25515a34.tar.gz ferdium-app-91c69428ed0dc2dd26b00c6dd5a6684f25515a34.tar.zst ferdium-app-91c69428ed0dc2dd26b00c6dd5a6684f25515a34.zip |
Cleanup/remove feature toggle for todo, workspace, service proxy (#2134)
* Remove DEFAULT_FEATURES_CONFIG from config
* Remove static controller
Co-authored-by: Madhuri B <MadhuriBandanadam@users.noreply.github.com>
Diffstat (limited to 'src/features/todos')
-rw-r--r-- | src/features/todos/index.ts | 25 | ||||
-rw-r--r-- | src/features/todos/store.js | 9 |
2 files changed, 2 insertions, 32 deletions
diff --git a/src/features/todos/index.ts b/src/features/todos/index.ts index 3665812e6..2fa8c3130 100644 --- a/src/features/todos/index.ts +++ b/src/features/todos/index.ts | |||
@@ -1,29 +1,8 @@ | |||
1 | import { reaction } from 'mobx'; | ||
2 | import TodoStore from './store'; | 1 | import TodoStore from './store'; |
3 | 2 | ||
4 | const debug = require('debug')('Ferdi:feature:todos'); | ||
5 | |||
6 | export const todosStore = new TodoStore(); | 3 | export const todosStore = new TodoStore(); |
7 | 4 | ||
8 | export default function initTodos( | 5 | export default function initTodos(stores: { todos?: any }, actions: any) { |
9 | stores: { todos?: any; features?: any }, | ||
10 | actions: any, | ||
11 | ) { | ||
12 | stores.todos = todosStore; | 6 | stores.todos = todosStore; |
13 | const { features } = stores; | 7 | todosStore.start(stores, actions); |
14 | |||
15 | // Toggle todos feature | ||
16 | reaction( | ||
17 | () => features.features.isTodosEnabled, | ||
18 | isEnabled => { | ||
19 | if (isEnabled) { | ||
20 | debug('Initializing `todos` feature'); | ||
21 | todosStore.start(stores, actions); | ||
22 | } else if (todosStore.isFeatureActive) { | ||
23 | debug('Disabling `todos` feature'); | ||
24 | todosStore.stop(); | ||
25 | } | ||
26 | }, | ||
27 | { fireImmediately: true }, | ||
28 | ); | ||
29 | } | 8 | } |
diff --git a/src/features/todos/store.js b/src/features/todos/store.js index 010a029ff..d158ed480 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js | |||
@@ -23,8 +23,6 @@ const debug = require('debug')('Ferdi:feature:todos:store'); | |||
23 | export default class TodoStore extends FeatureStore { | 23 | export default class TodoStore extends FeatureStore { |
24 | @observable stores = null; | 24 | @observable stores = null; |
25 | 25 | ||
26 | @observable isFeatureEnabled = false; | ||
27 | |||
28 | @observable isFeatureActive = false; | 26 | @observable isFeatureActive = false; |
29 | 27 | ||
30 | @observable webview = null; | 28 | @observable webview = null; |
@@ -123,7 +121,6 @@ export default class TodoStore extends FeatureStore { | |||
123 | // REACTIONS | 121 | // REACTIONS |
124 | 122 | ||
125 | this._allReactions = createReactions([ | 123 | this._allReactions = createReactions([ |
126 | this._setFeatureEnabledReaction, | ||
127 | this._updateTodosConfig, | 124 | this._updateTodosConfig, |
128 | this._firstLaunchReaction, | 125 | this._firstLaunchReaction, |
129 | this._routeCheckReaction, | 126 | this._routeCheckReaction, |
@@ -262,12 +259,6 @@ export default class TodoStore extends FeatureStore { | |||
262 | 259 | ||
263 | // Reactions | 260 | // Reactions |
264 | 261 | ||
265 | _setFeatureEnabledReaction = () => { | ||
266 | const { isTodosEnabled } = this.stores.features.features; | ||
267 | |||
268 | this.isFeatureEnabled = isTodosEnabled; | ||
269 | }; | ||
270 | |||
271 | _updateTodosConfig = () => { | 262 | _updateTodosConfig = () => { |
272 | // Resend the config if any part changes in Franz: | 263 | // Resend the config if any part changes in Franz: |
273 | this._onTodosClientInitialized(); | 264 | this._onTodosClientInitialized(); |