fix: load model fails - generating button is not updated (#2498)
This commit is contained in:
parent
c5c46494eb
commit
fe730fbe42
@ -43,7 +43,10 @@ export function useActiveModel() {
|
||||
|
||||
let model = downloadedModelsRef?.current.find((e) => e.id === modelId)
|
||||
|
||||
await stopModel().catch()
|
||||
const error = await stopModel().catch((error: Error) => error)
|
||||
if (error) {
|
||||
return Promise.reject(error)
|
||||
}
|
||||
|
||||
setLoadModelError(undefined)
|
||||
|
||||
|
||||
@ -112,6 +112,7 @@ export default function useSendChatMessage() {
|
||||
if (modelRef.current?.id !== modelId) {
|
||||
const error = await startModel(modelId).catch((error: Error) => error)
|
||||
if (error) {
|
||||
updateThreadWaiting(activeThreadRef.current.id, false)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user