From 3f06e3d35e83207d8623f86a8eb6f1ecca640336 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 6 Aug 2023 16:21:07 +0800 Subject: [PATCH] fix: filter summary messages will bypass recall message problem --- client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx b/client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx index 2152d50d..885ae6f9 100644 --- a/client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx +++ b/client/web/plugins/com.msgbyte.ai-assistant/src/popover.tsx @@ -144,7 +144,8 @@ export const AssistantPopover: React.FC<{ onClick={async () => { const plainMessages = ( await Promise.all( - messages + [...messages] + .filter((item) => !item.hasRecall) // filter recalled message .slice(messages.length - 30, messages.length) // get last 30 message, too much will throw error .map( async (item) =>