Show queue front icon when shift is pressed (#1157)

* Move shiftDown state to workspaceStateStore

* Queue front state
This commit is contained in:
Chenlei Hu
2024-10-07 19:54:00 -04:00
committed by GitHub
parent 2b26514190
commit 23952d9751
6 changed files with 44 additions and 23 deletions

View File

@@ -113,7 +113,6 @@ export class ComfyApp {
extensionManager: ExtensionManager
_nodeOutputs: Record<string, any>
nodePreviewImages: Record<string, typeof Image>
shiftDown: boolean
graph: LGraph
enableWorkflowViewRestore: any
canvas: LGraphCanvas
@@ -139,12 +138,20 @@ export class ComfyApp {
menu: ComfyAppMenu
bypassBgColor: string
// @deprecated
// Use useExecutionStore().executingNodeId instead
/**
* @deprecated Use useExecutionStore().executingNodeId instead
*/
get runningNodeId(): string | null {
return useExecutionStore().executingNodeId
}
/**
* @deprecated Use useWorkspaceStore().shiftDown instead
*/
get shiftDown(): boolean {
return useWorkspaceStore().shiftDown
}
constructor() {
this.vueAppReady = false
this.ui = new ComfyUI(this)
@@ -177,12 +184,6 @@ export class ComfyApp {
* @type {Record<string, Image>}
*/
this.nodePreviewImages = {}
/**
* If the shift key on the keyboard is pressed
* @type {boolean}
*/
this.shiftDown = false
}
get nodeOutputs() {
@@ -1617,15 +1618,6 @@ export class ComfyApp {
api.init()
}
#addKeyboardHandler() {
window.addEventListener('keydown', (e) => {
this.shiftDown = e.shiftKey
})
window.addEventListener('keyup', (e) => {
this.shiftDown = e.shiftKey
})
}
#addConfigureHandler() {
const app = this
const configure = LGraph.prototype.configure
@@ -1906,7 +1898,6 @@ export class ComfyApp {
this.#addDropHandler()
this.#addCopyHandler()
this.#addPasteHandler()
this.#addKeyboardHandler()
this.#addWidgetLinkHandling()
await this.#invokeExtensionsAsync('setup')