diff --git a/pyproject.toml b/pyproject.toml index 9db3300..6a56c4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-model-manager" description = "Manage models: browsing, download and delete." -version = "2.1.4" +version = "2.1.5" license = "LICENSE" dependencies = ["markdownify"] diff --git a/src/hooks/loading.ts b/src/hooks/loading.ts index 2a66005..889b471 100644 --- a/src/hooks/loading.ts +++ b/src/hooks/loading.ts @@ -38,19 +38,19 @@ declare module 'hooks/store' { } export const useLoading = () => { - const timer = ref() + const targetTimer = ref>({}) - const show = () => { - timer.value = setTimeout(() => { - timer.value = undefined + const show = (target: string = '_default') => { + targetTimer.value[target] = setTimeout(() => { + targetTimer.value[target] = undefined globalLoading.show() }, 200) } - const hide = () => { - if (timer.value) { - clearTimeout(timer.value) - timer.value = undefined + const hide = (target: string = '_default') => { + if (targetTimer.value) { + clearTimeout(targetTimer.value[target]) + targetTimer.value[target] = undefined } else { globalLoading.hide() } diff --git a/src/hooks/model.ts b/src/hooks/model.ts index fcaaa96..63c42d7 100644 --- a/src/hooks/model.ts +++ b/src/hooks/model.ts @@ -42,14 +42,14 @@ export const useModels = defineStore('models', (store) => { const models = ref>({}) const refreshModels = async (folder: string) => { - loading.show() + loading.show(folder) return request(`/models/${folder}`) .then((resData) => { models.value[folder] = resData return resData }) .finally(() => { - loading.hide() + loading.hide(folder) }) }