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

This commit is contained in:
quzard 2023-06-26 01:36:27 +08:00
parent 0d85dae239
commit c2724c6aad
1 changed files with 1 additions and 1 deletions

View File

@ -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) =>