diff options
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 168aa7e48..f9009af5a 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -8,6 +8,7 @@ import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; | |||
8 | import AutoLaunch from 'auto-launch'; | 8 | import AutoLaunch from 'auto-launch'; |
9 | import prettyBytes from 'pretty-bytes'; | 9 | import prettyBytes from 'pretty-bytes'; |
10 | import ms from 'ms'; | 10 | import ms from 'ms'; |
11 | import { URL } from 'url'; | ||
11 | 12 | ||
12 | import Store from './lib/Store'; | 13 | import Store from './lib/Store'; |
13 | import Request from './lib/Request'; | 14 | import Request from './lib/Request'; |
@@ -19,6 +20,7 @@ import { onVisibilityChange } from '../helpers/visibility-helper'; | |||
19 | import { getLocale } from '../helpers/i18n-helpers'; | 20 | import { getLocale } from '../helpers/i18n-helpers'; |
20 | 21 | ||
21 | import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js'; | 22 | import { getServiceIdsFromPartitions, removeServicePartitionDirectory } from '../helpers/service-helpers.js'; |
23 | import { isValidExternalURL } from '../helpers/url-helpers'; | ||
22 | 24 | ||
23 | const debug = require('debug')('Franz:AppStore'); | 25 | const debug = require('debug')('Franz:AppStore'); |
24 | 26 | ||
@@ -256,7 +258,14 @@ export default class AppStore extends Store { | |||
256 | } | 258 | } |
257 | 259 | ||
258 | @action _openExternalUrl({ url }) { | 260 | @action _openExternalUrl({ url }) { |
259 | shell.openExternal(url); | 261 | const parsedUrl = new URL(url); |
262 | debug('open external url', parsedUrl); | ||
263 | |||
264 | if (isValidExternalURL(url)) { | ||
265 | shell.openExternal(url); | ||
266 | } | ||
267 | |||
268 | gaEvent('External URL', 'open', parsedUrl.host); | ||
260 | } | 269 | } |
261 | 270 | ||
262 | @action _checkForUpdates() { | 271 | @action _checkForUpdates() { |