Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuu authored Apr 21, 2023
1 parent 56d098c commit 79f58f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export function Chat() {
}
};

const findLastUesrIndex = (messageId: number) => {
const findLastUserIndex = (messageId: number) => {
// find last user input message and resend
let lastUserMessageIndex: number | null = null;
for (let i = 0; i < session.messages.length; i += 1) {
Expand All @@ -568,14 +568,14 @@ export function Chat() {
};

const onDelete = (botMessageId: number) => {
const userIndex = findLastUesrIndex(botMessageId);
const userIndex = findLastUserIndex(botMessageId);
if (userIndex === null) return;
deleteMessage(userIndex);
};

const onResend = (botMessageId: number) => {
// find last user input message and resend
const userIndex = findLastUesrIndex(botMessageId);
const userIndex = findLastUserIndex(botMessageId);
if (userIndex === null) return;

setIsLoading(true);
Expand Down

0 comments on commit 79f58f5

Please sign in to comment.