Browse Source

Merge pull request #2133 from quzard/fix_pin_bug

Fix Pin Message
Yifei Zhang 1 year ago
parent
commit
d62eb56886
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/components/chat.tsx

+ 1 - 1
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) =>