diff --git a/web/containers/DropdownListSidebar/index.tsx b/web/containers/DropdownListSidebar/index.tsx index 2679d6869..75bbe073c 100644 --- a/web/containers/DropdownListSidebar/index.tsx +++ b/web/containers/DropdownListSidebar/index.tsx @@ -94,7 +94,7 @@ const DropdownListSidebar = ({ // This is fake loader please fix this when we have realtime percentage when load model useEffect(() => { - if (stateModel.loading) { + if (stateModel.model === selectedModel?.id && stateModel.loading) { if (loader === 24) { setTimeout(() => { setLoader(loader + 1) @@ -115,7 +115,7 @@ const DropdownListSidebar = ({ } else { setLoader(0) } - }, [stateModel.loading, loader]) + }, [stateModel.loading, loader, selectedModel, stateModel.model]) const onValueSelected = useCallback( async (modelId: string) => { @@ -159,12 +159,16 @@ const DropdownListSidebar = ({ return null } + const selectedModelLoading = + stateModel.model === selectedModel?.id && stateModel.loading + return ( <>