-
Notifications
You must be signed in to change notification settings - Fork 406
[TS] Fix ts-strict errors in Vue components (Part 2) #3123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" /> | ||
|
|
@@ -150,7 +150,7 @@ const isEmptySearch = computed(() => searchQuery.value === '') | |
| const getInstalledSearchResults = async () => { | ||
| if (isEmptySearch.value) return getInstalledPacks() | ||
| return searchResults.value.filter((pack) => | ||
| comfyManagerStore.installedPacksIds.has(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 })[] | ||
| ) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this, since we only need the key for the purpose of rendering, maybe we can just generate a unique key if the name doesn't exist
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am going to leave this change to you (in a separate PR) as it involves with larger scale logic change |
||
| const selectedNodePacks = ref<components['schemas']['Node'][]>([]) | ||
| const selectedNodePack = computed(() => | ||
| const selectedNodePack = computed<components['schemas']['Node'] | null>(() => | ||
| selectedNodePacks.value.length === 1 ? selectedNodePacks.value[0] : null | ||
| ) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.