mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 15:40:10 +00:00
Fix two undo steps on add node via context menu (#3674)
This commit is contained in:
@@ -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'
|
||||
@@ -301,17 +300,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
|
||||
|
||||
Reference in New Issue
Block a user