Skip to content

Commit

Permalink
Handle missing ref which appears to occur on first tick after re-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
joepavitt committed Sep 13, 2023
1 parent 156cc9f commit 51c9291
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/src/widgets/ui-markdown/UIMarkdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default {
renderMermaid () {
// remove hte flag that mermaid uses to work out if an element has been processed
// TODO: need to scope this to _just_ this component, otherwise it'll run for all mermaid charts on the page
this.$refs.markdown.querySelector('.mermaid')?.removeAttribute('data-processed')
this.$refs.markdown?.querySelector('.mermaid')?.removeAttribute('data-processed')
this.$nextTick(() => {
// let Vue render the dynamic markdown first, then re-render the chart
mermaid.run({
Expand Down

0 comments on commit 51c9291

Please sign in to comment.