mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-31 13:29:55 +00:00
[Manager] Fix infinite fetch attempts when response is empty (#3392)
This commit is contained in:
@@ -185,14 +185,16 @@ const {
|
||||
startFetchInstalled,
|
||||
filterInstalledPack,
|
||||
installedPacks,
|
||||
isLoading: isLoadingInstalled
|
||||
isLoading: isLoadingInstalled,
|
||||
isReady: installedPacksReady
|
||||
} = useInstalledPacks()
|
||||
|
||||
const {
|
||||
startFetchWorkflowPacks,
|
||||
filterWorkflowPack,
|
||||
workflowPacks,
|
||||
isLoading: isLoadingWorkflow
|
||||
isLoading: isLoadingWorkflow,
|
||||
isReady: workflowPacksReady
|
||||
} = useWorkflowPacks()
|
||||
|
||||
const filterMissingPacks = (packs: components['schemas']['Node'][]) =>
|
||||
@@ -236,7 +238,11 @@ watch([isInstalledTab, installedPacks], () => {
|
||||
|
||||
if (!isEmptySearch.value) {
|
||||
displayPacks.value = filterInstalledPack(searchResults.value)
|
||||
} else if (!installedPacks.value.length) {
|
||||
} else if (
|
||||
!installedPacks.value.length &&
|
||||
!installedPacksReady.value &&
|
||||
!isLoadingInstalled.value
|
||||
) {
|
||||
startFetchInstalled()
|
||||
} else {
|
||||
displayPacks.value = installedPacks.value
|
||||
@@ -250,7 +256,11 @@ watch([isMissingTab, isWorkflowTab, workflowPacks], () => {
|
||||
displayPacks.value = isMissingTab.value
|
||||
? filterMissingPacks(filterWorkflowPack(searchResults.value))
|
||||
: filterWorkflowPack(searchResults.value)
|
||||
} else if (!workflowPacks.value.length) {
|
||||
} else if (
|
||||
!workflowPacks.value.length &&
|
||||
!isLoadingWorkflow.value &&
|
||||
!workflowPacksReady.value
|
||||
) {
|
||||
startFetchWorkflowPacks()
|
||||
} else {
|
||||
displayPacks.value = isMissingTab.value
|
||||
|
||||
@@ -12,10 +12,8 @@ export const useInstalledPacks = (options: UseNodePacksOptions = {}) => {
|
||||
Array.from(comfyManagerStore.installedPacksIds)
|
||||
)
|
||||
|
||||
const { startFetch, cleanup, error, isLoading, nodePacks } = useNodePacks(
|
||||
installedPackIds,
|
||||
options
|
||||
)
|
||||
const { startFetch, cleanup, error, isLoading, nodePacks, isReady } =
|
||||
useNodePacks(installedPackIds, options)
|
||||
|
||||
const filterInstalledPack = (packs: components['schemas']['Node'][]) =>
|
||||
packs.filter((pack) => comfyManagerStore.isPackInstalled(pack.id))
|
||||
@@ -27,6 +25,7 @@ export const useInstalledPacks = (options: UseNodePacksOptions = {}) => {
|
||||
return {
|
||||
error,
|
||||
isLoading,
|
||||
isReady,
|
||||
installedPacks: nodePacks,
|
||||
startFetchInstalled: startFetch,
|
||||
filterInstalledPack
|
||||
|
||||
@@ -62,10 +62,8 @@ export const useWorkflowPacks = (options: UseNodePacksOptions = {}) => {
|
||||
Array.from(packsToUniqueIds(workflowPacks.value))
|
||||
)
|
||||
|
||||
const { startFetch, cleanup, error, isLoading, nodePacks } = useNodePacks(
|
||||
workflowPacksIds,
|
||||
options
|
||||
)
|
||||
const { startFetch, cleanup, error, isLoading, nodePacks, isReady } =
|
||||
useNodePacks(workflowPacksIds, options)
|
||||
|
||||
const isIdInWorkflow = (packId: string) =>
|
||||
workflowPacksIds.value.includes(packId)
|
||||
@@ -80,6 +78,7 @@ export const useWorkflowPacks = (options: UseNodePacksOptions = {}) => {
|
||||
return {
|
||||
error,
|
||||
isLoading,
|
||||
isReady,
|
||||
workflowPacks: nodePacks,
|
||||
startFetchWorkflowPacks: startFetch,
|
||||
filterWorkflowPack
|
||||
|
||||
Reference in New Issue
Block a user