Explorar el Código

Fix Pin Message: when userMessageIndex === 0, pinning a message was not possible.

quzard hace 1 año
padre
commit
c2724c6aad
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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) =>