mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-19 14:30:07 +00:00
Fix video previews not displayed if VHS previously installed but disabled or uninstalled (#3844)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { useExtensionStore } from '@/stores/extensionStore'
|
||||
import { ResultItemImpl } from '@/stores/queueStore'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
|
||||
@@ -16,9 +17,16 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
const settingStore = useSettingStore()
|
||||
const vhsAdvancedPreviews = computed(() =>
|
||||
settingStore.get('VHS.AdvancedPreviews')
|
||||
)
|
||||
const { isExtensionInstalled, isExtensionEnabled } = useExtensionStore()
|
||||
|
||||
const vhsAdvancedPreviews = computed(() => {
|
||||
return (
|
||||
isExtensionInstalled('VideoHelperSuite.Core') &&
|
||||
isExtensionEnabled('VideoHelperSuite.Core') &&
|
||||
settingStore.get('VHS.AdvancedPreviews') &&
|
||||
settingStore.get('VHS.AdvancedPreviews') !== 'Never'
|
||||
)
|
||||
})
|
||||
|
||||
const url = computed(() =>
|
||||
vhsAdvancedPreviews.value
|
||||
|
||||
@@ -451,7 +451,7 @@ const zSettings = z.object({
|
||||
'Comfy.Load3D.CameraType': z.enum(['perspective', 'orthographic']),
|
||||
'pysssss.SnapToGrid': z.boolean(),
|
||||
/** VHS setting is used for queue video preview support. */
|
||||
'VHS.AdvancedPreviews': z.boolean(),
|
||||
'VHS.AdvancedPreviews': z.string(),
|
||||
/** Settings used for testing */
|
||||
'test.setting': z.any(),
|
||||
'main.sub.setting.name': z.any(),
|
||||
|
||||
@@ -36,6 +36,8 @@ export const useExtensionStore = defineStore('extension', () => {
|
||||
)
|
||||
})
|
||||
|
||||
const isExtensionInstalled = (name: string) => name in extensionByName.value
|
||||
|
||||
const isExtensionEnabled = (name: string) =>
|
||||
!disabledExtensionNames.value.has(name)
|
||||
const enabledExtensions = computed(() => {
|
||||
@@ -96,6 +98,7 @@ export const useExtensionStore = defineStore('extension', () => {
|
||||
extensions,
|
||||
enabledExtensions,
|
||||
inactiveDisabledExtensionNames,
|
||||
isExtensionInstalled,
|
||||
isExtensionEnabled,
|
||||
isExtensionReadOnly,
|
||||
registerExtension,
|
||||
|
||||
Reference in New Issue
Block a user