aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-07-30 16:53:05 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-07-30 16:53:05 +0200
commit600fd80016a23f1cce9504f4681908325f50285d (patch)
treecba4c37bad75121c07488b22f8e84eeace496083 /src/stores
parentMake todo layer resizable (diff)
parentfeat(App): Add option to copy debug information via the help menu (diff)
downloadferdium-app-600fd80016a23f1cce9504f4681908325f50285d.tar.gz
ferdium-app-600fd80016a23f1cce9504f4681908325f50285d.tar.zst
ferdium-app-600fd80016a23f1cce9504f4681908325f50285d.zip
Merge branch 'develop' into feature/todos
Diffstat (limited to 'src/stores')
-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 72c4b4d0b..2ac306a2a 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