mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 19:36:53 +08:00
fix: fix issue with chat-input-area clearing during Responding state. (#12352)
This commit is contained in:
@@ -39,6 +39,7 @@ type ChatInputAreaProps = {
|
|||||||
inputs?: Record<string, any>
|
inputs?: Record<string, any>
|
||||||
inputsForm?: InputForm[]
|
inputsForm?: InputForm[]
|
||||||
theme?: Theme | null
|
theme?: Theme | null
|
||||||
|
isResponding?: boolean
|
||||||
}
|
}
|
||||||
const ChatInputArea = ({
|
const ChatInputArea = ({
|
||||||
showFeatureBar,
|
showFeatureBar,
|
||||||
@@ -51,6 +52,7 @@ const ChatInputArea = ({
|
|||||||
inputs = {},
|
inputs = {},
|
||||||
inputsForm = [],
|
inputsForm = [],
|
||||||
theme,
|
theme,
|
||||||
|
isResponding,
|
||||||
}: ChatInputAreaProps) => {
|
}: ChatInputAreaProps) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { notify } = useToastContext()
|
const { notify } = useToastContext()
|
||||||
@@ -77,6 +79,11 @@ const ChatInputArea = ({
|
|||||||
const historyRef = useRef([''])
|
const historyRef = useRef([''])
|
||||||
const [currentIndex, setCurrentIndex] = useState(-1)
|
const [currentIndex, setCurrentIndex] = useState(-1)
|
||||||
const handleSend = () => {
|
const handleSend = () => {
|
||||||
|
if (isResponding) {
|
||||||
|
notify({ type: 'info', message: t('appDebug.errorMessage.waitForResponse') })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (onSend) {
|
if (onSend) {
|
||||||
const { files, setFiles } = filesStore.getState()
|
const { files, setFiles } = filesStore.getState()
|
||||||
if (files.find(item => item.transferMethod === TransferMethod.local_file && !item.uploadedId)) {
|
if (files.find(item => item.transferMethod === TransferMethod.local_file && !item.uploadedId)) {
|
||||||
|
|||||||
@@ -292,6 +292,7 @@ const Chat: FC<ChatProps> = ({
|
|||||||
inputs={inputs}
|
inputs={inputs}
|
||||||
inputsForm={inputsForm}
|
inputsForm={inputsForm}
|
||||||
theme={themeBuilder?.theme}
|
theme={themeBuilder?.theme}
|
||||||
|
isResponding={isResponding}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user