Skip to content

Commit 8f33352

Browse files
Merge branch 'main' into winston/cnct-2497-unlink-auth-method-for-enclave-wallets
2 parents 1ac03e9 + 0842045 commit 8f33352

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,21 @@ export function ChatPageContent(props: {
242242
return;
243243
}
244244
console.error(error);
245-
setMessages((prev) => [
246-
...prev,
247-
{
245+
246+
setMessages((prev) => {
247+
const newMessages = prev.slice(
248+
0,
249+
prev[prev.length - 1]?.type === "presence" ? -1 : undefined,
250+
);
251+
252+
// add error message
253+
newMessages.push({
248254
text: `Error: ${error instanceof Error ? error.message : "Failed to execute command"}`,
249255
type: "error",
250-
},
251-
]);
256+
});
257+
258+
return newMessages;
259+
});
252260
} finally {
253261
setIsChatStreaming(false);
254262
}

0 commit comments

Comments
 (0)