Skip to content

Commit 7cc1e2f

Browse files
authored
Fix Web Handlers not executing with Re-ask option (#581)
* Fix Web Handlers not executing with Re-ask option * Fix typo in onResubmitClick param
1 parent 1863245 commit 7cc1e2f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/Message/MessageBase.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export interface MessageBaseProps {
8080
isLoading: boolean;
8181
hidePreviews?: boolean;
8282
onPrompt?: (prompt?: string) => void;
83-
onResubmitClick?: () => void;
83+
onResubmitClick?: (promptText?: string) => void;
8484
onDeleteBeforeClick?: () => void;
8585
onDeleteClick?: () => void;
8686
onDeleteAfterClick?: () => void;
@@ -337,7 +337,7 @@ function MessageBase({
337337
.finally(() => {
338338
onEditingChange(false);
339339
if (action === "resubmit" && onResubmitClick) {
340-
onResubmitClick();
340+
onResubmitClick(text);
341341
}
342342
messageForm.current?.removeAttribute("data-action");
343343
});

src/components/MessagesView.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ function MessagesView({
9797
message={message}
9898
chatId={chatId}
9999
isLoading={isLoading}
100-
onResubmitClick={async () => {
100+
onResubmitClick={async (promptText?: string) => {
101101
await deleteMessages(message.id, "after");
102-
onPrompt();
102+
onPrompt(promptText);
103103
}}
104104
onDeleteBeforeClick={
105105
hasMessagesBefore ? () => deleteMessages(message.id, "before") : undefined

0 commit comments

Comments
 (0)