mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-10 02:02:31 +08:00
fix: disable new chat button during streaming (#501)
This commit is contained in:
@@ -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`}
|
||||||
|
|||||||
Reference in New Issue
Block a user