Browse Source

Merge pull request #1338 from meriadec/fix/storybook

Fix storybook
master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
aa6b0dfc7e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/helpers/linking.js

9
src/helpers/linking.js

@ -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…
Cancel
Save