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:
@@ -1135,7 +1135,17 @@ export default class MarkdownPreview extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// other case
|
// 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 () {
|
render () {
|
||||||
|
|||||||
Reference in New Issue
Block a user