From c2724c6aad57cebbfb91ece669748119e3dda699 Mon Sep 17 00:00:00 2001 From: quzard <1191890118@qq.com> Date: Mon, 26 Jun 2023 01:36:27 +0800 Subject: [PATCH] Fix Pin Message: when userMessageIndex === 0, pinning a message was not possible. --- app/components/chat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 279addf6..8b7cd921 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -700,7 +700,7 @@ export function Chat() { const onPinMessage = (botMessage: ChatMessage) => { if (!botMessage.id) return; const userMessageIndex = findLastUserIndex(botMessage.id); - if (!userMessageIndex) return; + if (userMessageIndex === null) return; const userMessage = session.messages[userMessageIndex]; chatStore.updateCurrentSession((session) =>