[TS] Fix ts-strict errors in Vue components (Part 2) (#3123)

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
This commit is contained in:
Chenlei Hu
2025-03-18 10:51:23 -04:00
committed by GitHub
parent 0a6d3c0231
commit e8997a7653
19 changed files with 76 additions and 49 deletions

View File

@@ -83,7 +83,7 @@
<ContentDivider orientation="vertical" :width="0.2" />
<div class="flex-1 flex flex-col isolate">
<InfoPanel
v-if="!hasMultipleSelections"
v-if="!hasMultipleSelections && selectedNodePack"
:node-pack="selectedNodePack"
/>
<InfoPanelMultiItem v-else :node-packs="selectedNodePacks" />
@@ -149,8 +149,8 @@ const isEmptySearch = computed(() => searchQuery.value === '')
const getInstalledSearchResults = async () => {
if (isEmptySearch.value) return getInstalledPacks()
return searchResults.value.filter((pack) =>
comfyManagerStore.installedPacksIds.has(pack.name)
return searchResults.value.filter(
(pack) => pack.name && comfyManagerStore.installedPacksIds.has(pack.name)
)
}
@@ -162,15 +162,16 @@ watchEffect(async () => {
}
})
const resultsWithKeys = computed(() =>
displayPacks.value.map((item) => ({
...item,
key: item.id || item.name
}))
const resultsWithKeys = computed(
() =>
displayPacks.value.map((item) => ({
...item,
key: item.id || item.name
})) as (components['schemas']['Node'] & { key: string })[]
)
const selectedNodePacks = ref<components['schemas']['Node'][]>([])
const selectedNodePack = computed(() =>
const selectedNodePack = computed<components['schemas']['Node'] | null>(() =>
selectedNodePacks.value.length === 1 ? selectedNodePacks.value[0] : null
)