You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
364 B

// @flow
import { track } from 'analytics/segment'
7 years ago
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 })
7 years ago
shell && shell.openExternal(url)
}