This is an automated email from the ASF dual-hosted git repository.
shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/test by this push:
new 5bc5f3fb Feat/1.2.1/UI (#655)
5bc5f3fb is described below
commit 5bc5f3fba24b4135d82617267038215a564c0ba5
Author: dashuai <[email protected]>
AuthorDate: Fri Nov 24 15:49:47 2023 +0800
Feat/1.2.1/UI (#655)
---
ui/src/components/Editor/ToolBars/image.tsx | 4 ++--
ui/src/components/Editor/index.tsx | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/src/components/Editor/ToolBars/image.tsx
b/ui/src/components/Editor/ToolBars/image.tsx
index 1cfe1d9b..48f1b039 100644
--- a/ui/src/components/Editor/ToolBars/image.tsx
+++ b/ui/src/components/Editor/ToolBars/image.tsx
@@ -29,8 +29,8 @@ import { IEditorContext } from '../types';
import { uploadImage } from '@/services';
let context: IEditorContext;
-const Image = () => {
- const [editor, setEditor] = useState<Editor>(null);
+const Image = ({ editorInstance }) => {
+ const [editor, setEditor] = useState<Editor>(editorInstance);
const { t } = useTranslation('translation', { keyPrefix: 'editor' });
const loadingText = `![${t('image.uploading')}...]()`;
diff --git a/ui/src/components/Editor/index.tsx
b/ui/src/components/Editor/index.tsx
index f3295e10..8d157a68 100644
--- a/ui/src/components/Editor/index.tsx
+++ b/ui/src/components/Editor/index.tsx
@@ -126,7 +126,7 @@ const MDEditor: ForwardRefRenderFunction<EditorRef, Props>
= (
<Code />
<LinkItem />
<BlockQuote />
- <Image />
+ <Image editorInstance={editor} />
<Table />
<div className="toolbar-divider" />
<OL />