From 3843c2488df81840960d8db3cfdec33597e17159 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 4 Sep 2019 15:44:36 +0200 Subject: Resend todos config on Franz setting changes --- src/features/todos/store.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/features/todos/store.js') 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 { this._allReactions = createReactions([ this._setFeatureEnabledReaction, + this._updateTodosConfig, ]); this._registerReactions(this._allReactions); @@ -121,11 +122,14 @@ export default class TodoStore extends FeatureStore { // Todos client message handlers _onTodosClientInitialized = () => { + const { authToken } = this.stores.user; + const { isDarkThemeActive } = this.stores.ui; + if (!this.webview) return; this.webview.send(IPC.TODOS_HOST_CHANNEL, { action: 'todos:configure', data: { - authToken: this.stores.user.authToken, - theme: this.stores.ui.isDarkThemeActive ? ThemeType.dark : ThemeType.default, + authToken, + theme: isDarkThemeActive ? ThemeType.dark : ThemeType.default, }, }); }; @@ -144,4 +148,9 @@ export default class TodoStore extends FeatureStore { this.isFeatureEnabled = isTodosEnabled; }; + + _updateTodosConfig = () => { + // Resend the config if any part changes in Franz: + this._onTodosClientInitialized(); + } } -- cgit v1.2.3-70-g09d2 From 0fdf2677a9d01123b4d0a30ad10f717f972c6749 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Wed, 4 Sep 2019 16:29:27 +0200 Subject: Add locale to todos config --- src/features/todos/store.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/features/todos/store.js') diff --git a/src/features/todos/store.js b/src/features/todos/store.js index bb1df9415..242b38bf7 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js @@ -124,11 +124,13 @@ export default class TodoStore extends FeatureStore { _onTodosClientInitialized = () => { const { authToken } = this.stores.user; const { isDarkThemeActive } = this.stores.ui; + const { locale } = this.stores.app; if (!this.webview) return; this.webview.send(IPC.TODOS_HOST_CHANNEL, { action: 'todos:configure', data: { authToken, + locale, theme: isDarkThemeActive ? ThemeType.dark : ThemeType.default, }, }); -- cgit v1.2.3-70-g09d2