Gaëtan Renaudeau
7 years ago
committed by
GitHub
1 changed files with 7 additions and 2 deletions
@ -1,12 +1,17 @@ |
|||
// @flow
|
|||
import { shell } from 'electron' |
|||
import { track } from 'analytics/segment' |
|||
|
|||
let shell |
|||
if (!process.env.STORYBOOK_ENV) { |
|||
const electron = require('electron') |
|||
shell = electron.shell |
|||
} |
|||
|
|||
export const openURL = ( |
|||
url: string, |
|||
customEventName: string = 'OpenURL', |
|||
extraParams: Object = {}, |
|||
) => { |
|||
track(customEventName, { ...extraParams, url }) |
|||
shell.openExternal(url) |
|||
shell && shell.openExternal(url) |
|||
} |
|||
|
Loading…
Reference in new issue