fix displaying error message in mermaid, closes #3841

This commit is contained in:
zadam 2023-04-16 23:41:40 +02:00
parent 8226f62ded
commit 1d3272e9f8

View file

@ -73,6 +73,8 @@ export default class MermaidWidget extends NoteContextAwareWidget {
const wheelZoomLoaded = libraryLoader.requireLibrary(libraryLoader.WHEEL_ZOOM);
this.$errorContainer.hide();
try {
await this.renderSvg(async renderedSvg => {
this.$display.html(renderedSvg);
@ -87,8 +89,6 @@ export default class MermaidWidget extends NoteContextAwareWidget {
speed: 20,
zoomOnClick: false
});
this.$errorContainer.hide();
});
} catch (e) {
this.$errorMessage.text(e.message);