mirror of https://github.com/status-im/codimd.git
fix: catch viz.js render async error and recreate Viz instance
Signed-off-by: Max Wu <jackymaxj@gmail.com>
This commit is contained in:
parent
b260093947
commit
40a04f76f8
|
@ -31,7 +31,7 @@ require('prismjs/components/prism-gherkin')
|
|||
|
||||
require('./lib/common/login')
|
||||
require('../vendor/md-toc')
|
||||
const viz = new window.Viz()
|
||||
let viz = new window.Viz()
|
||||
const plantumlEncoder = require('plantuml-encoder')
|
||||
|
||||
const ui = getUIElements()
|
||||
|
@ -379,8 +379,13 @@ export function finishView (view) {
|
|||
$ele.addClass('graphviz')
|
||||
$value.children().unwrap()
|
||||
})
|
||||
.catch(err => {
|
||||
viz = new window.Viz()
|
||||
$value.parent().append(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)
|
||||
console.warn(err)
|
||||
})
|
||||
} catch (err) {
|
||||
$value.unwrap()
|
||||
viz = new window.Viz()
|
||||
$value.parent().append(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)
|
||||
console.warn(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue