|
@@ -39,6 +39,7 @@ type ChatInputAreaProps = {
|
|
|
inputs?: Record<string, any>
|
|
|
inputsForm?: InputForm[]
|
|
|
theme?: Theme | null
|
|
|
+ isResponding?: boolean
|
|
|
}
|
|
|
const ChatInputArea = ({
|
|
|
showFeatureBar,
|
|
@@ -51,6 +52,7 @@ const ChatInputArea = ({
|
|
|
inputs = {},
|
|
|
inputsForm = [],
|
|
|
theme,
|
|
|
+ isResponding,
|
|
|
}: ChatInputAreaProps) => {
|
|
|
const { t } = useTranslation()
|
|
|
const { notify } = useToastContext()
|
|
@@ -77,6 +79,11 @@ const ChatInputArea = ({
|
|
|
const historyRef = useRef([''])
|
|
|
const [currentIndex, setCurrentIndex] = useState(-1)
|
|
|
const handleSend = () => {
|
|
|
+ if (isResponding) {
|
|
|
+ notify({ type: 'info', message: t('appDebug.errorMessage.waitForResponse') })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (onSend) {
|
|
|
const { files, setFiles } = filesStore.getState()
|
|
|
if (files.find(item => item.transferMethod === TransferMethod.local_file && !item.uploadedId)) {
|
|
@@ -116,7 +123,7 @@ const ChatInputArea = ({
|
|
|
setQuery(historyRef.current[currentIndex + 1])
|
|
|
}
|
|
|
else if (currentIndex === historyRef.current.length - 1) {
|
|
|
- // If it is the last element, clear the input box
|
|
|
+ // If it is the last element, clear the input box
|
|
|
setCurrentIndex(historyRef.current.length)
|
|
|
setQuery('')
|
|
|
}
|