mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-31 05:19:53 +00:00
Update Template copy & paste (#1533)
* Split original clipboard functions out * Add version check for templates * Fix regression in use template undo steps
This commit is contained in:
@@ -64,6 +64,7 @@ import { shallowReactive } from 'vue'
|
||||
import { type IBaseWidget } from '@comfyorg/litegraph/dist/types/widgets'
|
||||
import { workflowService } from '@/services/workflowService'
|
||||
import { useWidgetStore } from '@/stores/widgetStore'
|
||||
import { deserialiseAndCreate } from '@/extensions/core/vintageClipboard'
|
||||
|
||||
export const ANIM_PREVIEW_WIDGET = '$$comfy_animation_preview'
|
||||
|
||||
@@ -2123,8 +2124,14 @@ export class ComfyApp {
|
||||
continue
|
||||
}
|
||||
|
||||
localStorage.setItem('litegrapheditor_clipboard', template.data)
|
||||
app.canvas.pasteFromClipboard()
|
||||
// Check for old clipboard format
|
||||
const data = JSON.parse(template.data)
|
||||
if (!data.reroutes) {
|
||||
deserialiseAndCreate(template.data, app.canvas)
|
||||
} else {
|
||||
localStorage.setItem('litegrapheditor_clipboard', template.data)
|
||||
app.canvas.pasteFromClipboard()
|
||||
}
|
||||
|
||||
// Move mouse position down to paste the next template below
|
||||
|
||||
|
||||
Reference in New Issue
Block a user