diff --git a/src/shared/components/PinnedFlowchartPanel.vue b/src/shared/components/PinnedFlowchartPanel.vue index af86561..0cef1fc 100644 --- a/src/shared/components/PinnedFlowchartPanel.vue +++ b/src/shared/components/PinnedFlowchartPanel.vue @@ -42,7 +42,7 @@ import { usePinnedFlowchartStore } from "shared/store/pinnedFlowchart" import { useMermaid } from "shared/composables/useMermaid" const store = usePinnedFlowchartStore() -const { renderError, renderFlowchart } = useMermaid() +const { renderError, renderFlowchart, clearError } = useMermaid() const panelRef = useTemplateRef("panel") const handleRef = useTemplateRef("handle") @@ -68,7 +68,9 @@ watch( ) watch(collapsed, async (val) => { - if (!val && store.mermaidCode) { + if (val) { + clearError() + } else if (store.mermaidCode) { await nextTick() await renderFlowchart(mermaidContainer.value, store.mermaidCode) }