Skip to content

Commit 1fc2c5b

Browse files
committed
fix: Disable chat input when the model is empty
1 parent 62e3cb3 commit 1fc2c5b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/frontend/client/src/components/Chat/Input/ChatForm.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ const ChatForm = ({ isLingsi, setShowCode, readOnly, index = 0 }) => {
137137
const disableInputs = useMemo(
138138
() => {
139139
if (readOnly) return true
140+
if (isLingsi) return false
140141
if (!bsConfig?.models) return true
141-
if (!isLingsi && bsConfig.models.length === 0) return true
142+
if (bsConfig.models.length === 0) return true
142143
return !!((requiresKey ?? false) || invalidAssistant)
143144
},
144145
[requiresKey, invalidAssistant, isLingsi, readOnly, bsConfig],
@@ -215,10 +216,11 @@ const ChatForm = ({ isLingsi, setShowCode, readOnly, index = 0 }) => {
215216

216217
const [audioOpening] = useRecordingAudioLoading()
217218
const noModel = useMemo(() => {
219+
if (isLingsi) return false
218220
if (!bsConfig?.models) return true
219221
if (bsConfig.models.length === 0) return true
220222
return false
221-
}, [bsConfig])
223+
}, [isLingsi, bsConfig])
222224

223225
return (
224226
<form

0 commit comments

Comments
 (0)