inline isFirefox

main
Mike Fix 3 years ago
parent a88f98ddfb
commit c3a7ad5d0f
No known key found for this signature in database
GPG Key ID: 1D85E862314CA79F

@ -77,12 +77,6 @@ class Editor extends React.Component {
}
this.setState(newState)
if (window.navigator) {
this.isFirefox =
window.navigator.userAgent.indexOf('Firefox') !== -1 &&
window.navigator.userAgent.indexOf('Chrome') === -1
}
}
carbonNode = React.createRef()
@ -191,7 +185,11 @@ class Editor extends React.Component {
if (format !== 'open') {
link.download = `${prefix}.${format}`
}
if (this.isFirefox) {
if (
// isFirefox
window.navigator.userAgent.indexOf('Firefox') !== -1 &&
window.navigator.userAgent.indexOf('Chrome') === -1
) {
link.target = '_blank'
}
link.href = url

Loading…
Cancel
Save