Fix sidebar splitter state (#1523)

This commit is contained in:
Chenlei Hu
2024-11-12 23:12:56 -05:00
committed by GitHub
parent d6e0c197bd
commit a73fdcd3bd

View File

@@ -1,7 +1,10 @@
<template> <template>
<teleport to=".graph-canvas-container"> <teleport to=".graph-canvas-container">
<!-- Load splitter overlay only after comfyApp is ready. -->
<!-- If load immediately, the top-level splitter stateKey won't be correctly
synced with the stateStorage (localStorage). -->
<LiteGraphCanvasSplitterOverlay <LiteGraphCanvasSplitterOverlay
v-if="betaMenuEnabled && !workspaceStore.focusMode" v-if="comfyAppReady && betaMenuEnabled && !workspaceStore.focusMode"
> >
<template #side-bar-panel> <template #side-bar-panel>
<SideToolbar /> <SideToolbar />
@@ -237,6 +240,7 @@ usePragmaticDroppable(() => canvasRef.value, {
} }
}) })
const comfyAppReady = ref(false)
onMounted(async () => { onMounted(async () => {
// Backward compatible // Backward compatible
// Assign all properties of lg to window // Assign all properties of lg to window
@@ -263,6 +267,7 @@ onMounted(async () => {
window['app'] = comfyApp window['app'] = comfyApp
window['graph'] = comfyApp.graph window['graph'] = comfyApp.graph
comfyAppReady.value = true
emit('ready') emit('ready')
}) })
</script> </script>