From 3e4bcdb4c8c49b756787f259e10108b392a52bad Mon Sep 17 00:00:00 2001 From: Amnish Date: Thu, 11 Apr 2024 19:01:44 -0400 Subject: [PATCH 1/2] Fix Web Handlers not executing with Re-ask option --- src/components/Message/MessageBase.tsx | 4 ++-- src/components/MessagesView.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Message/MessageBase.tsx b/src/components/Message/MessageBase.tsx index 4eaf9c80..005ddce8 100644 --- a/src/components/Message/MessageBase.tsx +++ b/src/components/Message/MessageBase.tsx @@ -80,7 +80,7 @@ export interface MessageBaseProps { isLoading: boolean; hidePreviews?: boolean; onPrompt?: (prompt?: string) => void; - onResubmitClick?: () => void; + onResubmitClick?: (promtText?: string) => void; onDeleteBeforeClick?: () => void; onDeleteClick?: () => void; onDeleteAfterClick?: () => void; @@ -337,7 +337,7 @@ function MessageBase({ .finally(() => { onEditingChange(false); if (action === "resubmit" && onResubmitClick) { - onResubmitClick(); + onResubmitClick(text); } messageForm.current?.removeAttribute("data-action"); }); diff --git a/src/components/MessagesView.tsx b/src/components/MessagesView.tsx index 59be9ac7..b521d1e3 100644 --- a/src/components/MessagesView.tsx +++ b/src/components/MessagesView.tsx @@ -97,9 +97,9 @@ function MessagesView({ message={message} chatId={chatId} isLoading={isLoading} - onResubmitClick={async () => { + onResubmitClick={async (promptText?: string) => { await deleteMessages(message.id, "after"); - onPrompt(); + onPrompt(promptText); }} onDeleteBeforeClick={ hasMessagesBefore ? () => deleteMessages(message.id, "before") : undefined From a3c31cc60d951261c41d66e37d381ae6d3f98549 Mon Sep 17 00:00:00 2001 From: Amnish Date: Fri, 12 Apr 2024 09:01:18 -0400 Subject: [PATCH 2/2] Fix typo in onResubmitClick param --- src/components/Message/MessageBase.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Message/MessageBase.tsx b/src/components/Message/MessageBase.tsx index 005ddce8..deb5356a 100644 --- a/src/components/Message/MessageBase.tsx +++ b/src/components/Message/MessageBase.tsx @@ -80,7 +80,7 @@ export interface MessageBaseProps { isLoading: boolean; hidePreviews?: boolean; onPrompt?: (prompt?: string) => void; - onResubmitClick?: (promtText?: string) => void; + onResubmitClick?: (promptText?: string) => void; onDeleteBeforeClick?: () => void; onDeleteClick?: () => void; onDeleteAfterClick?: () => void;