From 0b882d3b9a735f9c2dc5b95b03642aa49cf22d7a Mon Sep 17 00:00:00 2001 From: sunshinesmilelk <1176136681@qq.com> Date: Wed, 17 Jan 2024 20:18:01 +0800 Subject: [PATCH] fix(code-editor): fix the editor in CodeEditorView is undefined --- .changeset/clean-kiwis-laugh.md | 32 +++++++++++++++++++ .../src/code-editor-view.tsx | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .changeset/clean-kiwis-laugh.md diff --git a/.changeset/clean-kiwis-laugh.md b/.changeset/clean-kiwis-laugh.md new file mode 100644 index 00000000..8296d2ea --- /dev/null +++ b/.changeset/clean-kiwis-laugh.md @@ -0,0 +1,32 @@ +--- +'@difizen/libro-code-editor': patch +'@difizen/libro-docs': patch +'@difizen/libro-code-cell': patch +'@difizen/libro-codemirror': patch +'@difizen/libro-cofine-editor': patch +'@difizen/libro-cofine-editor-contribution': patch +'@difizen/libro-cofine-editor-core': patch +'@difizen/libro-cofine-textmate': patch +'@difizen/libro-common': patch +'@difizen/libro-core': patch +'@difizen/libro-jupyter': patch +'@difizen/libro-kernel': patch +'@difizen/libro-l10n': patch +'@difizen/libro-lab': patch +'@difizen/libro-lsp': patch +'@difizen/libro-markdown': patch +'@difizen/libro-markdown-cell': patch +'@difizen/libro-output': patch +'@difizen/libro-prompt-cell': patch +'@difizen/libro-raw-cell': patch +'@difizen/libro-rendermime': patch +'@difizen/libro-search': patch +'@difizen/libro-search-code-cell': patch +'@difizen/libro-shared-model': patch +'@difizen/libro-terminal': patch +'@difizen/libro-toc': patch +'@difizen/libro-virtualized': patch +'@difizen/libro-widget': patch +--- + +1. prompt cell adapt to the api of libro-server 2.fix the editor in CodeEditorView is undefined diff --git a/packages/libro-code-editor/src/code-editor-view.tsx b/packages/libro-code-editor/src/code-editor-view.tsx index bed35385..d414cdbc 100644 --- a/packages/libro-code-editor/src/code-editor-view.tsx +++ b/packages/libro-code-editor/src/code-editor-view.tsx @@ -148,7 +148,7 @@ export class CodeEditorView extends BaseView { }; override onViewUnmount = () => { - if (this.editor.dispose) { + if (this.editor) { this.editor.dispose(); }