fix: Passing model object instead of model id

This commit is contained in:
hiro 2023-12-05 02:03:12 +07:00
parent 06ca4142bf
commit 4266d86226

View File

@ -51,17 +51,16 @@ export default function EventHandler({ children }: { children: ReactNode }) {
addNewMessage(message)
}
async function handleModelReady(res: any) {
const model = modelsRef.current?.find((e) => e.id === res.modelId)
async function handleModelReady(model: Model) {
setActiveModel(model)
toaster({
title: 'Success!',
description: `Model ${res.modelId} has been started.`,
description: `Model ${model.id} has been started.`,
})
setStateModel(() => ({
state: 'stop',
loading: false,
model: res.modelId,
model: model.id,
}))
}