fix(core): missing clean up subscription (#10636)

This commit is contained in:
akumatus
2025-03-06 07:00:57 +00:00
parent ec9bd1f383
commit cd884312ea
3 changed files with 29 additions and 21 deletions

View File

@@ -54,7 +54,6 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
chatPanelRef.current = new ChatPanel();
chatPanelRef.current.host = editor.host;
chatPanelRef.current.doc = editor.doc;
containerRef.current?.append(chatPanelRef.current);
const searchService = framework.get(AINetworkSearchService);
const docDisplayMetaService = framework.get(DocDisplayMetaService);
const workspaceService = framework.get(WorkspaceService);
@@ -101,6 +100,7 @@ export const EditorChatPanel = forwardRef(function EditorChatPanel(
SpecProvider._.getSpec('preview:page')
);
chatPanelRef.current.previewSpecBuilder = previewSpecBuilder;
containerRef.current?.append(chatPanelRef.current);
} else {
chatPanelRef.current.host = editor.host;
chatPanelRef.current.doc = editor.doc;