fix: globalThis.editor is undefined (#1590)

This commit is contained in:
hanchayi
2023-03-16 11:35:37 +08:00
committed by GitHub
parent efcf1fcaa0
commit 1a0abbf76e

View File

@@ -84,7 +84,7 @@ export const EditorOptionMenu = () => {
<MenuItem
onClick={() => {
// @ts-expect-error
globalThis.editor.contentParser.onExportHtml();
globalThis.currentEditor.contentParser.onExportHtml();
}}
icon={<ExportToHtmlIcon />}
iconSize={[20, 20]}
@@ -94,7 +94,7 @@ export const EditorOptionMenu = () => {
<MenuItem
onClick={() => {
// @ts-expect-error
globalThis.editor.contentParser.onExportMarkdown();
globalThis.currentEditor.contentParser.onExportMarkdown();
}}
icon={<ExportToMarkdownIcon />}
iconSize={[20, 20]}