mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 05:49:54 +00:00
Enable ts-strict for commandStore (#1321)
This commit is contained in:
@@ -188,7 +188,6 @@ export class ClipspaceDialog extends ComfyDialog {
|
||||
app.registerExtension({
|
||||
name: 'Comfy.Clipspace',
|
||||
init(app) {
|
||||
// @ts-expect-error Move to ComfyApp
|
||||
app.openClipspace = function () {
|
||||
if (!ClipspaceDialog.instance) {
|
||||
ClipspaceDialog.instance = new ClipspaceDialog()
|
||||
|
||||
@@ -148,6 +148,8 @@ export class ComfyApp {
|
||||
canvasContainer: HTMLElement
|
||||
menu: ComfyAppMenu
|
||||
bypassBgColor: string
|
||||
// Set by Comfy.Clipspace extension
|
||||
openClipspace: () => void = () => {}
|
||||
|
||||
/**
|
||||
* @deprecated Use useExecutionStore().executingNodeId instead
|
||||
|
||||
@@ -611,7 +611,6 @@ export class ComfyUI {
|
||||
$el('button', {
|
||||
id: 'comfy-clipspace-button',
|
||||
textContent: 'Clipspace',
|
||||
// @ts-expect-error Move to ComfyApp
|
||||
onclick: () => app.openClipspace()
|
||||
}),
|
||||
$el('button', {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// @ts-strict-ignore
|
||||
import { app } from '@/scripts/app'
|
||||
import { api } from '@/scripts/api'
|
||||
import { defineStore } from 'pinia'
|
||||
@@ -123,7 +122,7 @@ export const useCommandStore = defineStore('command', () => {
|
||||
app.workflowManager.setWorkflow(null)
|
||||
app.clean()
|
||||
app.graph.clear()
|
||||
app.workflowManager.activeWorkflow.track()
|
||||
app.workflowManager.activeWorkflow?.track()
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -149,7 +148,7 @@ export const useCommandStore = defineStore('command', () => {
|
||||
label: 'Save Workflow',
|
||||
menubarLabel: 'Save',
|
||||
function: () => {
|
||||
app.workflowManager.activeWorkflow.save()
|
||||
app.workflowManager.activeWorkflow?.save()
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -158,7 +157,7 @@ export const useCommandStore = defineStore('command', () => {
|
||||
label: 'Save Workflow As',
|
||||
menubarLabel: 'Save As',
|
||||
function: () => {
|
||||
app.workflowManager.activeWorkflow.save(true)
|
||||
app.workflowManager.activeWorkflow?.save(true)
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -223,7 +222,7 @@ export const useCommandStore = defineStore('command', () => {
|
||||
icon: 'pi pi-clipboard',
|
||||
label: 'Clipspace',
|
||||
function: () => {
|
||||
app['openClipspace']?.()
|
||||
app.openClipspace()
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -274,10 +273,10 @@ export const useCommandStore = defineStore('command', () => {
|
||||
label: 'Zoom In',
|
||||
function: () => {
|
||||
const ds = app.canvas.ds
|
||||
ds.changeScale(ds.scale * 1.1, [
|
||||
ds.element.width / 2,
|
||||
ds.element.height / 2
|
||||
])
|
||||
ds.changeScale(
|
||||
ds.scale * 1.1,
|
||||
ds.element ? [ds.element.width / 2, ds.element.height / 2] : undefined
|
||||
)
|
||||
app.canvas.setDirty(true, true)
|
||||
}
|
||||
},
|
||||
@@ -287,10 +286,10 @@ export const useCommandStore = defineStore('command', () => {
|
||||
label: 'Zoom Out',
|
||||
function: () => {
|
||||
const ds = app.canvas.ds
|
||||
ds.changeScale(ds.scale / 1.1, [
|
||||
ds.element.width / 2,
|
||||
ds.element.height / 2
|
||||
])
|
||||
ds.changeScale(
|
||||
ds.scale / 1.1,
|
||||
ds.element ? [ds.element.width / 2, ds.element.height / 2] : undefined
|
||||
)
|
||||
app.canvas.setDirty(true, true)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user