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';
5
5
import { type Component } from 'obsidian' ;
6
6
import type JsEnginePlugin from 'jsEngine/main' ;
7
7
import { ReactiveComponent } from 'jsEngine/api/reactive/ReactiveComponent' ;
8
+ import { mount , unmount } from 'svelte' ;
8
9
9
10
/**
10
11
* Attaches to a container and renders values.
@@ -56,7 +57,7 @@ export class ResultRenderer {
56
57
}
57
58
58
59
if ( value instanceof MessageWrapper ) {
59
- new MessageComponent ( {
60
+ const svelteComponent = mount ( MessageComponent , {
60
61
target : this . container ,
61
62
props : {
62
63
messageWrapper : value ,
@@ -65,6 +66,10 @@ export class ResultRenderer {
65
66
showMessageSource : false ,
66
67
} ,
67
68
} ) ;
69
+
70
+ this . component . register ( ( ) => {
71
+ unmount ( svelteComponent ) ;
72
+ } )
68
73
return ;
69
74
}
70
75
You can’t perform that action at this time.
0 commit comments