refac: mermaid chart rendering

This commit is contained in:
Timothy J. Baek
2024-08-14 17:34:44 +02:00
parent 6a1e7ab038
commit 609a42c29c
3 changed files with 30 additions and 18 deletions
@@ -2,7 +2,6 @@
import { toast } from 'svelte-sonner';
import dayjs from 'dayjs';
import { marked } from 'marked';
import mermaid from 'mermaid';
import { fade } from 'svelte/transition';
import { createEventDispatcher } from 'svelte';
@@ -277,18 +276,11 @@
$: if (!edit) {
(async () => {
await tick();
await mermaid.run({
querySelector: '.mermaid'
});
})();
}
onMount(async () => {
await tick();
await mermaid.run({
querySelector: '.mermaid'
});
});
</script>