From ec7703ec8da0d204dc2aa884bbba87bebe3a144b Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 24 Nov 2023 22:30:03 +0700 Subject: [PATCH] chore: app raises error when attempting to start a model that is already starting --- web/hooks/useActiveModel.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/hooks/useActiveModel.ts b/web/hooks/useActiveModel.ts index 20b8aec15..db70b0aeb 100644 --- a/web/hooks/useActiveModel.ts +++ b/web/hooks/useActiveModel.ts @@ -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 }