aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2019-07-30 15:33:29 +0200
committerLibravatar Stefan Malzner <stefan@adlk.io>2019-07-30 15:33:29 +0200
commit4666e85de5c40e4cd7fa952a1d1c873a43dc60fb (patch)
treec53dad1ac7eea1641b79825d0d171bb027603b60 /src/stores
parentfix(Notifications): Fix issue that blocked notifications from e.g. Slack (diff)
downloadferdium-app-4666e85de5c40e4cd7fa952a1d1c873a43dc60fb.tar.gz
ferdium-app-4666e85de5c40e4cd7fa952a1d1c873a43dc60fb.tar.zst
ferdium-app-4666e85de5c40e4cd7fa952a1d1c873a43dc60fb.zip
feat(App): Add option to copy debug information via the help menu
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/AppStore.js25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index bca20a581..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,