Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

website: Fix typo onEditPrompt ChatConversation #3421

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion website/src/components/Chat/ChatConversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export const ChatConversation = memo(function ChatConversation({ chatId, getConf
isSending={isSending}
retryingParentId={retryingParentId}
activeThreadTailMessageId={activeThreadTailMessageId}
onEditPromtp={handleEditPrompt}
onEditPrompt={handleEditPrompt}
showEncourageMessage={showEncourageMessage}
onEncourageMessageClose={setShowEncourageMessage.off}
></ChatConversationTree>
Expand Down
10 changes: 5 additions & 5 deletions website/src/components/Chat/ChatMessageEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export type ChatMessageEntryProps = {
onRetry?: (params: { parentId: string; chatId: string }) => void;
isSending?: boolean;
pagingSlot?: ReactNode;
onEditPromtp?: (params: EditPromptParams) => void;
onEditPrompt?: (params: EditPromptParams) => void;
canRetry?: boolean;
id?: string;
"data-id"?: string;
Expand All @@ -46,7 +46,7 @@ export const ChatMessageEntry = memo(function ChatMessageEntry({
isSending,
message,
pagingSlot,
onEditPromtp,
onEditPrompt,
canRetry,
showEncourageMessage,
onEncourageMessageClose,
Expand Down Expand Up @@ -93,11 +93,11 @@ export const ChatMessageEntry = memo(function ChatMessageEntry({
const inputRef = useRef<HTMLTextAreaElement>(null);

const handleEditSubmit = useCallback(() => {
if (onEditPromtp && inputRef.current?.value && parentId !== null) {
onEditPromtp({ parentId, chatId, content: inputRef.current?.value });
if (onEditPrompt && inputRef.current?.value && parentId !== null) {
onEditPrompt({ parentId, chatId, content: inputRef.current?.value });
}
setIsEditing.off();
}, [chatId, onEditPromtp, parentId, setIsEditing]);
}, [chatId, onEditPrompt, parentId, setIsEditing]);

const ref = useRef<HTMLDivElement>(null);

Expand Down