diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-09-04 15:44:36 +0200 |
---|---|---|
committer | Dominik Guzei <dominik.guzei@gmail.com> | 2019-09-04 15:44:36 +0200 |
commit | 3843c2488df81840960d8db3cfdec33597e17159 (patch) | |
tree | 638571fb96ccd7ffd882399bbf98dee03bc1f023 /src/features/todos/store.js | |
parent | update todos app url (diff) | |
download | ferdium-app-3843c2488df81840960d8db3cfdec33597e17159.tar.gz ferdium-app-3843c2488df81840960d8db3cfdec33597e17159.tar.zst ferdium-app-3843c2488df81840960d8db3cfdec33597e17159.zip |
Resend todos config on Franz setting changes
Diffstat (limited to 'src/features/todos/store.js')
-rw-r--r-- | src/features/todos/store.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/features/todos/store.js b/src/features/todos/store.js index acf95df0d..bb1df9415 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js | |||
@@ -59,6 +59,7 @@ export default class TodoStore extends FeatureStore { | |||
59 | 59 | ||
60 | this._allReactions = createReactions([ | 60 | this._allReactions = createReactions([ |
61 | this._setFeatureEnabledReaction, | 61 | this._setFeatureEnabledReaction, |
62 | this._updateTodosConfig, | ||
62 | ]); | 63 | ]); |
63 | 64 | ||
64 | this._registerReactions(this._allReactions); | 65 | this._registerReactions(this._allReactions); |
@@ -121,11 +122,14 @@ export default class TodoStore extends FeatureStore { | |||
121 | // Todos client message handlers | 122 | // Todos client message handlers |
122 | 123 | ||
123 | _onTodosClientInitialized = () => { | 124 | _onTodosClientInitialized = () => { |
125 | const { authToken } = this.stores.user; | ||
126 | const { isDarkThemeActive } = this.stores.ui; | ||
127 | if (!this.webview) return; | ||
124 | this.webview.send(IPC.TODOS_HOST_CHANNEL, { | 128 | this.webview.send(IPC.TODOS_HOST_CHANNEL, { |
125 | action: 'todos:configure', | 129 | action: 'todos:configure', |
126 | data: { | 130 | data: { |
127 | authToken: this.stores.user.authToken, | 131 | authToken, |
128 | theme: this.stores.ui.isDarkThemeActive ? ThemeType.dark : ThemeType.default, | 132 | theme: isDarkThemeActive ? ThemeType.dark : ThemeType.default, |
129 | }, | 133 | }, |
130 | }); | 134 | }); |
131 | }; | 135 | }; |
@@ -144,4 +148,9 @@ export default class TodoStore extends FeatureStore { | |||
144 | 148 | ||
145 | this.isFeatureEnabled = isTodosEnabled; | 149 | this.isFeatureEnabled = isTodosEnabled; |
146 | }; | 150 | }; |
151 | |||
152 | _updateTodosConfig = () => { | ||
153 | // Resend the config if any part changes in Franz: | ||
154 | this._onTodosClientInitialized(); | ||
155 | } | ||
147 | } | 156 | } |