mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-03 10:00:22 +08:00
fix: restore save button disabled check and add displayName
This commit is contained in:
@@ -197,6 +197,7 @@ export const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
|
||||
) => {
|
||||
const dict = useDictionary()
|
||||
const {
|
||||
chartXML,
|
||||
diagramHistory,
|
||||
saveDiagramToFile,
|
||||
showSaveDialog,
|
||||
@@ -483,7 +484,9 @@ export const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setShowSaveDialog(true)}
|
||||
disabled={isDisabled}
|
||||
disabled={
|
||||
isDisabled || !isRealDiagram(chartXML)
|
||||
}
|
||||
tooltipContent={dict.chat.saveDiagram}
|
||||
className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
@@ -586,3 +589,5 @@ export const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
ChatInput.displayName = "ChatInput"
|
||||
|
||||
@@ -888,7 +888,6 @@ export default function ChatPanel({
|
||||
dict.dialogs.clearSuccess,
|
||||
buildSessionData,
|
||||
setDiagramHistory,
|
||||
chatInputRef,
|
||||
])
|
||||
|
||||
const handleInputChange = (
|
||||
|
||||
Reference in New Issue
Block a user