4545
4646<script setup lang="ts">
4747import type { LGraphNode } from ' @comfyorg/litegraph'
48+ import { useEventListener } from ' @vueuse/core'
4849import { computed , onMounted , ref , watch , watchEffect } from ' vue'
4950
5051import LiteGraphCanvasSplitterOverlay from ' @/components/LiteGraphCanvasSplitterOverlay.vue'
@@ -83,6 +84,7 @@ import { useExecutionStore } from '@/stores/executionStore'
8384import { useCanvasStore } from ' @/stores/graphStore'
8485import { useNodeDefStore } from ' @/stores/nodeDefStore'
8586import { useSettingStore } from ' @/stores/settingStore'
87+ import { useToastStore } from ' @/stores/toastStore'
8688import { useColorPaletteStore } from ' @/stores/workspace/colorPaletteStore'
8789import { useWorkspaceStore } from ' @/stores/workspaceStore'
8890
@@ -95,6 +97,7 @@ const nodeDefStore = useNodeDefStore()
9597const workspaceStore = useWorkspaceStore ()
9698const canvasStore = useCanvasStore ()
9799const executionStore = useExecutionStore ()
100+ const toastStore = useToastStore ()
98101const betaMenuEnabled = computed (
99102 () => settingStore .get (' Comfy.UseNewMenu' ) !== ' Disabled'
100103)
@@ -248,6 +251,19 @@ watch(
248251 }
249252)
250253
254+ useEventListener (
255+ canvasRef ,
256+ ' litegraph:no-items-selected' ,
257+ () => {
258+ toastStore .add ({
259+ severity: ' warn' ,
260+ summary: ' No items selected' ,
261+ life: 2000
262+ })
263+ },
264+ { passive: true }
265+ )
266+
251267const loadCustomNodesI18n = async () => {
252268 try {
253269 const i18nData = await api .getCustomNodesI18n ()
0 commit comments