aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r--src/stores/AppStore.js34
1 files changed, 10 insertions, 24 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index 168aa7e48..7784ff1f9 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -3,11 +3,11 @@ import {
3 action, computed, observable, reaction, 3 action, computed, observable, reaction,
4} from 'mobx'; 4} from 'mobx';
5import moment from 'moment'; 5import moment from 'moment';
6import key from 'keymaster';
7import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; 6import { getDoNotDisturb } from '@meetfranz/electron-notification-state';
8import AutoLaunch from 'auto-launch'; 7import AutoLaunch from 'auto-launch';
9import prettyBytes from 'pretty-bytes'; 8import prettyBytes from 'pretty-bytes';
10import ms from 'ms'; 9import ms from 'ms';
10import { URL } from 'url';
11 11
12import Store from './lib/Store'; 12import Store from './lib/Store';
13import Request from './lib/Request'; 13import Request from './lib/Request';
@@ -19,6 +19,7 @@ import { onVisibilityChange } from '../helpers/visibility-helper';
19import { getLocale } from '../helpers/i18n-helpers'; 19import { getLocale } from '../helpers/i18n-helpers';
20 20
21import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js'; 21import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js';
22import { isValidExternalURL } from '../helpers/url-helpers';
22 23
23const debug = require('debug')('Franz:AppStore'); 24const debug = require('debug')('Franz:AppStore');
24 25
@@ -155,27 +156,6 @@ export default class AppStore extends Store {
155 this.stores.router.push(url); 156 this.stores.router.push(url);
156 }); 157 });
157 158
158 // Set active the next service
159 key(
160 '⌘+pagedown, ctrl+pagedown, ⌘+alt+right, ctrl+tab', () => {
161 this.actions.service.setActiveNext();
162 },
163 );
164
165 // Set active the prev service
166 key(
167 '⌘+pageup, ctrl+pageup, ⌘+alt+left, ctrl+shift+tab', () => {
168 this.actions.service.setActivePrev();
169 },
170 );
171
172 // Global Mute
173 key(
174 '⌘+shift+m ctrl+shift+m', () => {
175 this.actions.app.toggleMuteApp();
176 },
177 );
178
179 this.locale = this._getDefaultLocale(); 159 this.locale = this._getDefaultLocale();
180 160
181 this._healthCheck(); 161 this._healthCheck();
@@ -256,7 +236,14 @@ export default class AppStore extends Store {
256 } 236 }
257 237
258 @action _openExternalUrl({ url }) { 238 @action _openExternalUrl({ url }) {
259 shell.openExternal(url); 239 const parsedUrl = new URL(url);
240 debug('open external url', parsedUrl);
241
242 if (isValidExternalURL(url)) {
243 shell.openExternal(url);
244 }
245
246 gaEvent('External URL', 'open', parsedUrl.host);
260 } 247 }
261 248
262 @action _checkForUpdates() { 249 @action _checkForUpdates() {
@@ -280,7 +267,6 @@ export default class AppStore extends Store {
280 267
281 @action _muteApp({ isMuted, overrideSystemMute = true }) { 268 @action _muteApp({ isMuted, overrideSystemMute = true }) {
282 this.isSystemMuteOverridden = overrideSystemMute; 269 this.isSystemMuteOverridden = overrideSystemMute;
283
284 this.actions.settings.update({ 270 this.actions.settings.update({
285 type: 'app', 271 type: 'app',
286 data: { 272 data: {