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

main
quzard 2 years ago
parent 0d85dae239
commit c2724c6aad

@ -700,7 +700,7 @@ export function Chat() {
const onPinMessage = (botMessage: ChatMessage) => { const onPinMessage = (botMessage: ChatMessage) => {
if (!botMessage.id) return; if (!botMessage.id) return;
const userMessageIndex = findLastUserIndex(botMessage.id); const userMessageIndex = findLastUserIndex(botMessage.id);
if (!userMessageIndex) return; if (userMessageIndex === null) return;
const userMessage = session.messages[userMessageIndex]; const userMessage = session.messages[userMessageIndex];
chatStore.updateCurrentSession((session) => chatStore.updateCurrentSession((session) =>

Loading…
Cancel
Save