LCOV - code coverage report
Current view: top level - src/composables/graph - useCanvasRefresh.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 100.0 % 10 10
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : // call nextTick on all changeTracker
       2              : import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
       3              : import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
       4              : 
       5              : /**
       6              :  * Composable for refreshing nodes in the graph
       7              :  * */
       8        11775 : export function useCanvasRefresh() {
       9        11775 :   const canvasStore = useCanvasStore()
      10        11775 :   const workflowStore = useWorkflowStore()
      11        11775 :   const refreshCanvas = () => {
      12            9 :     canvasStore.canvas?.emitBeforeChange()
      13            9 :     canvasStore.canvas?.setDirty(true, true)
      14            9 :     canvasStore.canvas?.graph?.afterChange()
      15            9 :     canvasStore.canvas?.emitAfterChange()
      16            9 :     workflowStore.activeWorkflow?.changeTracker.captureCanvasState()
      17              :   }
      18              : 
      19        11775 :   return {
      20              :     refreshCanvas
      21              :   }
      22              : }
        

Generated by: LCOV version 2.0-1