File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import MessageComponent from 'jsEngine/messages/MessageComponent.svelte';
55import { type Component } from 'obsidian' ;
66import type JsEnginePlugin from 'jsEngine/main' ;
77import { ReactiveComponent } from 'jsEngine/api/reactive/ReactiveComponent' ;
8+ import { mount , unmount } from 'svelte' ;
89
910/**
1011 * Attaches to a container and renders values.
@@ -56,7 +57,7 @@ export class ResultRenderer {
5657 }
5758
5859 if ( value instanceof MessageWrapper ) {
59- new MessageComponent ( {
60+ const svelteComponent = mount ( MessageComponent , {
6061 target : this . container ,
6162 props : {
6263 messageWrapper : value ,
@@ -65,6 +66,10 @@ export class ResultRenderer {
6566 showMessageSource : false ,
6667 } ,
6768 } ) ;
69+
70+ this . component . register ( ( ) => {
71+ unmount ( svelteComponent ) ;
72+ } )
6873 return ;
6974 }
7075
You can’t perform that action at this time.
0 commit comments