Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 1x 1x | const userAgent = navigator.userAgent.toLowerCase(); /** * Action creator for opening links. * * @param {Object} href - The link. * * @returns {Function} The open link function. */ export const openLink = (href) => () => { if (userAgent.indexOf('electron') > -1) { const { shell } = require('electron'); shell.openExternal(href); } else { window.open(href, '_new'); } }; |