1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-12 17:26:17 +00:00
* WIP: Fix #3397

* fixup! WIP: Fix #3397

* fix: catch potential URIError threw from decodeURI
This commit is contained in:
hiiwave
2020-02-03 19:33:38 +08:00
committed by GitHub
parent f367e9f08c
commit 051ce9e208

View File

@@ -1135,7 +1135,17 @@ export default class MarkdownPreview extends React.Component {
}
// other case
shell.openExternal(href)
this.openExternal(href)
}
openExternal (href) {
try {
const success = shell.openExternal(href) || shell.openExternal(decodeURI(href))
if (!success) console.error('failed to open url ' + href)
} catch (e) {
// URI Error threw from decodeURI
console.error(e)
}
}
render () {