Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,6 @@ export function ChatPageContent(props: {
chatAbortController?.abort();
setChatAbortController(undefined);
setIsChatStreaming(false);
// if last message is presence, remove it
if (messages[messages.length - 1]?.type === "presence") {
setMessages((prev) => prev.slice(0, -1));
}
}}
context={contextFilters}
setContext={(v) => {
Expand Down
18 changes: 15 additions & 3 deletions apps/dashboard/src/app/nebula-app/(app)/components/Chats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export function Chats(props: {
isMessagePending={isMessagePending}
client={props.client}
sendMessage={props.sendMessage}
nextMessage={props.messages[index + 1]}
/>
</ScrollShadow>

Expand Down Expand Up @@ -207,8 +208,9 @@ function RenderMessage(props: {
isMessagePending: boolean;
client: ThirdwebClient;
sendMessage: (message: string) => void;
nextMessage: ChatMessage | undefined;
}) {
const { message, isMessagePending, client, sendMessage } = props;
const { message, isMessagePending, client, sendMessage, nextMessage } = props;

switch (message.type) {
case "assistant":
Expand Down Expand Up @@ -237,6 +239,11 @@ function RenderMessage(props: {
txData={message.data}
client={client}
onTxSettled={(txHash) => {
// do not send automatic prompt if there is another transaction after this one
if (nextMessage?.type === "action") {
return;
}

sendMessage(getTransactionSettledPrompt(txHash));
}}
/>
Expand All @@ -254,8 +261,13 @@ function RenderMessage(props: {
<SwapTransactionCard
swapData={message.data}
client={client}
onTxSettled={() => {
// no op
onTxSettled={(txHash) => {
// do not send automatic prompt if there is another transaction after this one
if (nextMessage?.type === "action") {
return;
}

sendMessage(getTransactionSettledPrompt(txHash));
}}
/>
);
Expand Down
Loading