chore: app raises error when attempting to start a model that is already starting

This commit is contained in:
Louis 2023-11-24 22:30:03 +07:00
parent ff01a6e7ed
commit ec7703ec8d

View File

@ -23,7 +23,10 @@ export function useActiveModel() {
const { downloadedModels } = useGetDownloadedModels()
const startModel = async (modelId: string) => {
if (activeModel && activeModel.id === modelId) {
if (
(activeModel && activeModel.id === modelId) ||
(stateModel.model === modelId && stateModel.loading)
) {
console.debug(`Model ${modelId} is already init. Ignore..`)
return
}