Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/searchbox/NodeSearchBoxPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { useLitegraphService } from '@/services/litegraphService'
import { useCanvasStore } from '@/stores/graphStore'
import { ComfyNodeDefImpl, useNodeDefStore } from '@/stores/nodeDefStore'
import { useSettingStore } from '@/stores/settingStore'
import { useWorkflowStore } from '@/stores/workflowStore'
import { useSearchBoxStore } from '@/stores/workspace/searchBoxStore'
import { LinkReleaseTriggerAction } from '@/types/searchBoxTypes'
import { FuseFilterWithValue } from '@/utils/fuseUtil'
Expand Down Expand Up @@ -101,6 +102,8 @@ const addNode = (nodeDef: ComfyNodeDefImpl) => {

canvasStore.getCanvas().linkConnector.connectToNode(node, triggerEvent)

// Notify changeTracker - new step should be added
useWorkflowStore().activeWorkflow?.changeTracker?.checkState()
window.requestAnimationFrame(closeDialog)
}

Expand Down
12 changes: 0 additions & 12 deletions src/scripts/changeTracker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { LGraphCanvas, LiteGraph } from '@comfyorg/litegraph'
import { LGraphNode } from '@comfyorg/litegraph'
import * as jsondiffpatch from 'jsondiffpatch'
import _ from 'lodash'
import log from 'loglevel'
Expand Down Expand Up @@ -308,17 +307,6 @@ export class ChangeTracker {
return v
}

// Detects nodes being added via the node search dialog
const onNodeAdded = LiteGraph.LGraph.prototype.onNodeAdded
LiteGraph.LGraph.prototype.onNodeAdded = function (node: LGraphNode) {
const v = onNodeAdded?.apply(this, [node])
if (!app?.configuringGraph) {
logger.debug('checkState on onNodeAdded')
checkState()
}
return v
}

// Handle multiple commands as a single transaction
document.addEventListener('litegraph:canvas', (e: Event) => {
const detail = (e as CustomEvent).detail
Expand Down