From d79a62bf455ce0aa268b8582438433eab4413b6d Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Wed, 20 Mar 2024 18:02:34 +0800 Subject: [PATCH] perf: improve mention list to make sure its will work fine in huge group --- client/web/src/components/ChatBox/ChatInputBox/input.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/web/src/components/ChatBox/ChatInputBox/input.tsx b/client/web/src/components/ChatBox/ChatInputBox/input.tsx index 35c9d47a..ee65d8fa 100644 --- a/client/web/src/components/ChatBox/ChatInputBox/input.tsx +++ b/client/web/src/components/ChatBox/ChatInputBox/input.tsx @@ -60,7 +60,12 @@ export const ChatInputBoxInput: React.FC = React.memo( > + (users ?? []) + .filter((u) => u.display?.includes(query)) + .slice(0, 20) // max display 20 item at most + } displayTransform={(id, display) => `@${display}`} appendSpaceOnAdd={true} renderSuggestion={(suggestion) => (