From 1c8108b36bbe6c67fac53996d4e9b9799e29352b Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 19 May 2023 15:49:46 +0800 Subject: [PATCH] refactor: filter non-mention like url into meta --- client/web/src/components/ChatBox/ChatInputBox/input.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/web/src/components/ChatBox/ChatInputBox/input.tsx b/client/web/src/components/ChatBox/ChatInputBox/input.tsx index 771081d3..e396ca05 100644 --- a/client/web/src/components/ChatBox/ChatInputBox/input.tsx +++ b/client/web/src/components/ChatBox/ChatInputBox/input.tsx @@ -46,7 +46,7 @@ export const ChatInputBoxInput: React.FC = React.memo( onChange={(e, newValue, _, mentions) => props.onChange( newValue, - mentions.map((m) => m.id) + mentions.filter((m) => m.display.startsWith('@')).map((m) => m.id) // 仅处理mention的数据进行记录 ) } onKeyDown={props.onKeyDown}