From b25b22259bd628b806baf120e7e6050121a58f98 Mon Sep 17 00:00:00 2001 From: Shinji-Li <1349021570@qq.com> Date: Thu, 14 Mar 2024 12:33:26 +0800 Subject: [PATCH] :bug: fix: slove markdown style null render problem (#124) --- src/EditableMessage/index.tsx | 2 +- src/MessageModal/index.tsx | 4 ++-- src/ProChat/demos/doc-mode.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EditableMessage/index.tsx b/src/EditableMessage/index.tsx index 2fc4162d..76765afb 100644 --- a/src/EditableMessage/index.tsx +++ b/src/EditableMessage/index.tsx @@ -136,7 +136,7 @@ const EditableMessage = memo( height: isAutoSize ? 'unset' : height, overflowX: 'hidden', overflowY: 'auto', - ...markdownProps.style, + ...markdownProps?.style, }} > {value || placeholder} diff --git a/src/MessageModal/index.tsx b/src/MessageModal/index.tsx index a7437598..d7342a1a 100644 --- a/src/MessageModal/index.tsx +++ b/src/MessageModal/index.tsx @@ -115,10 +115,10 @@ const MessageModal = memo( {...markdownProps} style={ value - ? { ...markdownStyle, ...markdownProps.style } + ? { ...markdownStyle, ...markdownProps?.style } : { ...markdownStyle, - ...markdownProps.style, + ...markdownProps?.style, opacity: 0.5, } } diff --git a/src/ProChat/demos/doc-mode.tsx b/src/ProChat/demos/doc-mode.tsx index a97f4f68..9dc8f415 100644 --- a/src/ProChat/demos/doc-mode.tsx +++ b/src/ProChat/demos/doc-mode.tsx @@ -13,7 +13,7 @@ export default () => { return (
{ const mockedData: string = `这是一段模拟的流式字符串数据。本次会话传入了${messages.length}条消息`;