fix: disable new chat button during streaming (#501)

This commit is contained in:
Dayuan Jiang
2026-01-04 11:28:24 +09:00
committed by GitHub
parent 4dc774d03f
commit 814f448cb0

View File

@@ -1150,7 +1150,10 @@ export default function ChatPanel({
<button <button
type="button" type="button"
onClick={handleNewChat} onClick={handleNewChat}
className="flex items-center gap-2 overflow-x-hidden hover:opacity-80 transition-opacity cursor-pointer" disabled={
status === "streaming" || status === "submitted"
}
className="flex items-center gap-2 overflow-x-hidden hover:opacity-80 transition-opacity cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed"
title={dict.nav.newChat} title={dict.nav.newChat}
> >
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
@@ -1178,7 +1181,10 @@ export default function ChatPanel({
variant="ghost" variant="ghost"
size="icon" size="icon"
onClick={handleNewChat} onClick={handleNewChat}
className="hover:bg-accent" disabled={
status === "streaming" || status === "submitted"
}
className="hover:bg-accent disabled:opacity-50 disabled:cursor-not-allowed"
> >
<MessageSquarePlus <MessageSquarePlus
className={`${isMobile ? "h-4 w-4" : "h-5 w-5"} text-muted-foreground`} className={`${isMobile ? "h-4 w-4" : "h-5 w-5"} text-muted-foreground`}