diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-08-09 08:33:13 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-08-09 08:33:13 +0200 |
commit | 74c1ee9bc3460b6de4bd153a0be873819f7aacd6 (patch) | |
tree | c8b915d15691adcbd92baea157344db1f0447889 /src/stores/AppStore.js | |
parent | Add option to subscribe to trial via account dashboard (diff) | |
parent | bump version (diff) | |
download | ferdium-app-74c1ee9bc3460b6de4bd153a0be873819f7aacd6.tar.gz ferdium-app-74c1ee9bc3460b6de4bd153a0be873819f7aacd6.tar.zst ferdium-app-74c1ee9bc3460b6de4bd153a0be873819f7aacd6.zip |
Merge branch 'develop' into feature/new-pricing
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 55ee52b18..6054e6721 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -8,6 +8,9 @@ import AutoLaunch from 'auto-launch'; | |||
8 | import prettyBytes from 'pretty-bytes'; | 8 | import prettyBytes from 'pretty-bytes'; |
9 | import ms from 'ms'; | 9 | import ms from 'ms'; |
10 | import { URL } from 'url'; | 10 | import { URL } from 'url'; |
11 | import os from 'os'; | ||
12 | import path from 'path'; | ||
13 | import { readJsonSync } from 'fs-extra'; | ||
11 | 14 | ||
12 | import Store from './lib/Store'; | 15 | import Store from './lib/Store'; |
13 | import Request from './lib/Request'; | 16 | import Request from './lib/Request'; |
@@ -23,7 +26,7 @@ import { isValidExternalURL } from '../helpers/url-helpers'; | |||
23 | 26 | ||
24 | const debug = require('debug')('Franz:AppStore'); | 27 | const debug = require('debug')('Franz:AppStore'); |
25 | 28 | ||
26 | const { app, systemPreferences } = remote; | 29 | const { app, systemPreferences, screen } = remote; |
27 | 30 | ||
28 | const mainWindow = remote.getCurrentWindow(); | 31 | const mainWindow = remote.getCurrentWindow(); |
29 | 32 | ||
@@ -182,6 +185,26 @@ export default class AppStore extends Store { | |||
182 | return prettyBytes(this.getAppCacheSizeRequest.execute().result || 0); | 185 | return prettyBytes(this.getAppCacheSizeRequest.execute().result || 0); |
183 | } | 186 | } |
184 | 187 | ||
188 | @computed get debugInfo() { | ||
189 | return { | ||
190 | host: { | ||
191 | platform: process.platform, | ||
192 | release: os.release(), | ||
193 | screens: screen.getAllDisplays(), | ||
194 | }, | ||
195 | franz: { | ||
196 | version: app.getVersion(), | ||
197 | electron: process.versions.electron, | ||
198 | installedRecipes: this.stores.recipes.all.map(recipe => ({ id: recipe.id, version: recipe.version })), | ||
199 | devRecipes: this.stores.recipePreviews.dev.map(recipe => ({ id: recipe.id, version: recipe.version })), | ||
200 | services: this.stores.services.all.map(service => ({ id: service.id, recipe: service.recipe.id })), | ||
201 | workspaces: this.stores.workspaces.workspaces.map(workspace => ({ id: workspace.id, services: workspace.services })), | ||
202 | windowSettings: readJsonSync(path.join(app.getPath('userData'), 'window-state.json')), | ||
203 | user: this.stores.user.data.id, | ||
204 | }, | ||
205 | }; | ||
206 | } | ||
207 | |||
185 | // Actions | 208 | // Actions |
186 | @action _notify({ | 209 | @action _notify({ |
187 | title, options, notificationId, serviceId = null, | 210 | title, options, notificationId, serviceId = null, |
@@ -189,7 +212,7 @@ export default class AppStore extends Store { | |||
189 | if (this.stores.settings.all.app.isAppMuted) return; | 212 | if (this.stores.settings.all.app.isAppMuted) return; |
190 | 213 | ||
191 | // TODO: is there a simple way to use blobs for notifications without storing them on disk? | 214 | // TODO: is there a simple way to use blobs for notifications without storing them on disk? |
192 | if (options.icon.startsWith('blob:')) { | 215 | if (options.icon && options.icon.startsWith('blob:')) { |
193 | delete options.icon; | 216 | delete options.icon; |
194 | } | 217 | } |
195 | 218 | ||