diff options
author | Bennett <hello@vantezzen.io> | 2020-06-21 09:19:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-21 12:49:59 +0530 |
commit | 0d6d623d1e34cdbff2d46229165b49289a9a0619 (patch) | |
tree | 83f6a22a08e354da58adf3ed0393f4d39bca6124 /src/stores | |
parent | Prepare and Release/5.6.0 beta.1 (#820) (diff) | |
download | ferdium-app-0d6d623d1e34cdbff2d46229165b49289a9a0619.tar.gz ferdium-app-0d6d623d1e34cdbff2d46229165b49289a9a0619.tar.zst ferdium-app-0d6d623d1e34cdbff2d46229165b49289a9a0619.zip |
Add FAB to service dashboard (#824)
* Implement #387
* Fix lint
* Upgrade to Electron 9
* Remove dependency on electron-spellchecker
* Allow multiple languages to be selected
* Fix lint
* Don't show spellchecker language chooser for macOS
* Fix _requireAuthenticatedUser throwing error on startup
* Add FAB
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/ServicesStore.js | 13 | ||||
-rw-r--r-- | src/stores/UserStore.js | 4 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/stores/ServicesStore.js b/src/stores/ServicesStore.js index a8d9cc1fb..448260638 100644 --- a/src/stores/ServicesStore.js +++ b/src/stores/ServicesStore.js | |||
@@ -618,7 +618,10 @@ export default class ServicesStore extends Store { | |||
618 | const service = this.one(serviceId); | 618 | const service = this.one(serviceId); |
619 | 619 | ||
620 | if (service.webview) { | 620 | if (service.webview) { |
621 | service.webview.send(channel, args); | 621 | // Make sure the args are clean, otherwise ElectronJS can't transmit them |
622 | const cleanArgs = JSON.parse(JSON.stringify(args)); | ||
623 | |||
624 | service.webview.send(channel, cleanArgs); | ||
622 | } | 625 | } |
623 | } | 626 | } |
624 | 627 | ||
@@ -895,10 +898,14 @@ export default class ServicesStore extends Store { | |||
895 | const service = this.one(serviceId); | 898 | const service = this.one(serviceId); |
896 | 899 | ||
897 | if (service.webview) { | 900 | if (service.webview) { |
901 | // We need to completely clone the object, otherwise Electron won't be able to send the object via IPC | ||
902 | const shareWithWebview = JSON.parse(JSON.stringify(service.shareWithWebview)); | ||
903 | |||
898 | debug('Initialize recipe', service.recipe.id, service.name); | 904 | debug('Initialize recipe', service.recipe.id, service.name); |
899 | service.webview.send('initialize-recipe', Object.assign({ | 905 | service.webview.send('initialize-recipe', { |
906 | ...shareWithWebview, | ||
900 | franzVersion: app.getVersion(), | 907 | franzVersion: app.getVersion(), |
901 | }, service.shareWithWebview), service.recipe); | 908 | }, service.recipe); |
902 | } | 909 | } |
903 | } | 910 | } |
904 | 911 | ||
diff --git a/src/stores/UserStore.js b/src/stores/UserStore.js index 3a53d150d..c1ed2944a 100644 --- a/src/stores/UserStore.js +++ b/src/stores/UserStore.js | |||
@@ -99,7 +99,7 @@ export default class UserStore extends Store { | |||
99 | 99 | ||
100 | // Reactions | 100 | // Reactions |
101 | this.registerReactions([ | 101 | this.registerReactions([ |
102 | this._requireAuthenticatedUser, | 102 | this._requireAuthenticatedUser.bind(this), |
103 | this._getUserData.bind(this), | 103 | this._getUserData.bind(this), |
104 | this._resetTrialActivationState.bind(this), | 104 | this._resetTrialActivationState.bind(this), |
105 | ]); | 105 | ]); |
@@ -321,7 +321,7 @@ export default class UserStore extends Store { | |||
321 | } | 321 | } |
322 | 322 | ||
323 | const { router } = this.stores; | 323 | const { router } = this.stores; |
324 | const currentRoute = router.location.pathname; | 324 | const currentRoute = window.location.hash; |
325 | if (!this.isLoggedIn | 325 | if (!this.isLoggedIn |
326 | && currentRoute.includes('token=')) { | 326 | && currentRoute.includes('token=')) { |
327 | router.push(this.WELCOME_ROUTE); | 327 | router.push(this.WELCOME_ROUTE); |