Store spinner state in workspace state store (#256)

This commit is contained in:
Chenlei Hu
2024-07-29 10:54:22 -04:00
committed by GitHub
parent 66b690e5c8
commit 0aa7d0b99a
3 changed files with 14 additions and 7 deletions

View File

@@ -19,22 +19,29 @@ import { app as comfyApp } from '@/scripts/app'
import { useSettingStore } from '@/stores/settingStore'
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'
import { useNodeDefStore } from '@/stores/nodeDefStore'
import { useWorkspaceStore } from '@/stores/workspaceStateStore'
const emit = defineEmits(['ready'])
const canvasRef = ref<HTMLCanvasElement | null>(null)
const settingStore = useSettingStore()
const workspaceStore = useWorkspaceStore()
const betaMenuEnabled = computed(
() => useSettingStore().get('Comfy.UseNewMenu') !== 'Disabled'
() => settingStore.get('Comfy.UseNewMenu') !== 'Disabled'
)
const nodeSearchEnabled = computed<boolean>(
() => useSettingStore().get('Comfy.NodeSearchBoxImpl') === 'default'
() => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default'
)
let dropTargetCleanup = () => {}
onMounted(async () => {
comfyApp.vueAppReady = true
workspaceStore.spinner = true
await comfyApp.setup(canvasRef.value)
workspaceStore.spinner = false
window['app'] = comfyApp
window['graph'] = comfyApp.graph