mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 19:21:54 +00:00
Update ws message schema on reconnecting (#390)
* Update ws message schema on reconnecting * nit
This commit is contained in:
@@ -16,7 +16,7 @@ export function getInteruptButton(visibility: string) {
|
|||||||
api.addEventListener(
|
api.addEventListener(
|
||||||
'status',
|
'status',
|
||||||
({ detail }: CustomEvent<StatusWsMessageStatus>) => {
|
({ detail }: CustomEvent<StatusWsMessageStatus>) => {
|
||||||
const sz = detail.exec_info.queue_remaining
|
const sz = detail?.exec_info?.queue_remaining
|
||||||
btn.enabled = sz > 0
|
btn.enabled = sz > 0
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export class ComfyQueueButton {
|
|||||||
api.addEventListener(
|
api.addEventListener(
|
||||||
'status',
|
'status',
|
||||||
({ detail }: CustomEvent<StatusWsMessageStatus>) => {
|
({ detail }: CustomEvent<StatusWsMessageStatus>) => {
|
||||||
this.#internalQueueSize = detail.exec_info.queue_remaining
|
this.#internalQueueSize = detail?.exec_info?.queue_remaining
|
||||||
if (this.#internalQueueSize != null) {
|
if (this.#internalQueueSize != null) {
|
||||||
if (!this.#internalQueueSize && !app.lastExecutionError) {
|
if (!this.#internalQueueSize && !app.lastExecutionError) {
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ export const useQueuePendingTaskCountStore = defineStore(
|
|||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
update(e: CustomEvent<StatusWsMessageStatus>) {
|
update(e: CustomEvent<StatusWsMessageStatus>) {
|
||||||
this.count = e.detail.exec_info.queue_remaining
|
this.count = e.detail?.exec_info?.queue_remaining || 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const zStatusWsMessageStatus = z.object({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const zStatusWsMessage = z.object({
|
const zStatusWsMessage = z.object({
|
||||||
status: zStatusWsMessageStatus
|
status: zStatusWsMessageStatus.nullable().optional()
|
||||||
})
|
})
|
||||||
|
|
||||||
const zProgressWsMessage = z.object({
|
const zProgressWsMessage = z.object({
|
||||||
|
|||||||
Reference in New Issue
Block a user