aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-08-09 08:33:13 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-08-09 08:33:13 +0200
commit74c1ee9bc3460b6de4bd153a0be873819f7aacd6 (patch)
treec8b915d15691adcbd92baea157344db1f0447889 /src/stores/AppStore.js
parentAdd option to subscribe to trial via account dashboard (diff)
parentbump version (diff)
downloadferdium-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.js27
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';
8import prettyBytes from 'pretty-bytes'; 8import prettyBytes from 'pretty-bytes';
9import ms from 'ms'; 9import ms from 'ms';
10import { URL } from 'url'; 10import { URL } from 'url';
11import os from 'os';
12import path from 'path';
13import { readJsonSync } from 'fs-extra';
11 14
12import Store from './lib/Store'; 15import Store from './lib/Store';
13import Request from './lib/Request'; 16import Request from './lib/Request';
@@ -23,7 +26,7 @@ import { isValidExternalURL } from '../helpers/url-helpers';
23 26
24const debug = require('debug')('Franz:AppStore'); 27const debug = require('debug')('Franz:AppStore');
25 28
26const { app, systemPreferences } = remote; 29const { app, systemPreferences, screen } = remote;
27 30
28const mainWindow = remote.getCurrentWindow(); 31const 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