Compare commits

...

4 Commits

Author SHA1 Message Date
bymyself
289817402c await toolbox commands added by extensions 2025-04-11 07:38:09 -07:00
bymyself
cb8ada3723 await queue prompt 2025-04-11 07:37:51 -07:00
bymyself
3d18bf75d9 await queue button actions 2025-04-11 07:32:14 -07:00
bymyself
ad0d1833d2 await command executions 2025-04-11 07:30:39 -07:00
7 changed files with 29 additions and 17 deletions

View File

@@ -47,7 +47,7 @@
:disabled="!executingPrompt"
text
:aria-label="$t('menu.interrupt')"
@click="() => commandStore.execute('Comfy.Interrupt')"
@click="async () => await commandStore.execute('Comfy.Interrupt')"
>
</Button>
<Button
@@ -61,9 +61,9 @@
text
:aria-label="$t('sideToolbar.queueTab.clearPendingTasks')"
@click="
() => {
async () => {
if (queueCountStore.count.value > 1) {
commandStore.execute('Comfy.ClearPendingTasks')
await commandStore.execute('Comfy.ClearPendingTasks')
}
queueMode = 'disabled'
}
@@ -135,12 +135,12 @@ const hasPendingTasks = computed(
)
const commandStore = useCommandStore()
const queuePrompt = (e: Event) => {
const queuePrompt = async (e: Event) => {
const commandId =
'shiftKey' in e && e.shiftKey
? 'Comfy.QueuePromptFront'
: 'Comfy.QueuePrompt'
commandStore.execute(commandId)
await commandStore.execute(commandId)
}
</script>

View File

@@ -23,7 +23,7 @@
icon="pi pi-expand"
v-tooltip.left="t('graphCanvasMenu.fitView')"
:aria-label="$t('graphCanvasMenu.fitView')"
@click="() => commandStore.execute('Comfy.Canvas.FitView')"
@click="async () => await commandStore.execute('Comfy.Canvas.FitView')"
/>
<Button
severity="secondary"
@@ -39,7 +39,7 @@
(canvasStore.canvas?.read_only ? 'panMode' : 'selectMode')
)
"
@click="() => commandStore.execute('Comfy.Canvas.ToggleLock')"
@click="async () => await commandStore.execute('Comfy.Canvas.ToggleLock')"
>
<template #icon>
<i-material-symbols:pan-tool-outline
@@ -53,7 +53,10 @@
:icon="linkHidden ? 'pi pi-eye-slash' : 'pi pi-eye'"
v-tooltip.left="t('graphCanvasMenu.toggleLinkVisibility')"
:aria-label="$t('graphCanvasMenu.toggleLinkVisibility')"
@click="() => commandStore.execute('Comfy.Canvas.ToggleLinkVisibility')"
@click="
async () =>
await commandStore.execute('Comfy.Canvas.ToggleLinkVisibility')
"
data-testid="toggle-link-visibility-button"
/>
</ButtonGroup>

View File

@@ -12,7 +12,8 @@
severity="secondary"
text
@click="
() => commandStore.execute('Comfy.Canvas.ToggleSelectedNodes.Bypass')
async () =>
await commandStore.execute('Comfy.Canvas.ToggleSelectedNodes.Bypass')
"
data-testid="bypass-button"
v-tooltip.top="{
@@ -29,7 +30,10 @@
severity="secondary"
text
icon="pi pi-thumbtack"
@click="() => commandStore.execute('Comfy.Canvas.ToggleSelected.Pin')"
@click="
async () =>
await commandStore.execute('Comfy.Canvas.ToggleSelected.Pin')
"
v-tooltip.top="{
value: t('commands.Comfy_Canvas_ToggleSelectedNodes_Pin.label'),
showDelay: 1000
@@ -39,7 +43,10 @@
severity="danger"
text
icon="pi pi-trash"
@click="() => commandStore.execute('Comfy.Canvas.DeleteSelectedItems')"
@click="
async () =>
await commandStore.execute('Comfy.Canvas.DeleteSelectedItems')
"
v-tooltip.top="{
value: t('commands.Comfy_Canvas_DeleteSelectedItems.label'),
showDelay: 1000
@@ -58,7 +65,7 @@
severity="secondary"
text
:icon="typeof command.icon === 'function' ? command.icon() : command.icon"
@click="() => commandStore.execute(command.id)"
@click="async () => await commandStore.execute(command.id)"
v-tooltip.top="{
value:
st(`commands.${normalizeI18nKey(command.id)}.label`, '') || undefined,

View File

@@ -23,7 +23,7 @@ const icon = computed(() =>
)
const commandStore = useCommandStore()
const toggleTheme = () => {
commandStore.execute('Comfy.ToggleTheme')
const toggleTheme = async () => {
await commandStore.execute('Comfy.ToggleTheme')
}
</script>

View File

@@ -36,7 +36,9 @@
icon="pi pi-stop"
severity="danger"
text
@click="() => commandStore.execute('Comfy.ClearPendingTasks')"
@click="
async () => await commandStore.execute('Comfy.ClearPendingTasks')
"
v-tooltip.bottom="$t('sideToolbar.queueTab.clearPendingTasks')"
/>
<Button

View File

@@ -34,7 +34,7 @@
text
severity="secondary"
:aria-label="$t('sideToolbar.newBlankWorkflow')"
@click="() => commandStore.execute('Comfy.NewBlankWorkflow')"
@click="async () => await commandStore.execute('Comfy.NewBlankWorkflow')"
/>
<ContextMenu ref="menu" :model="contextMenuItems" />
</div>

View File

@@ -44,7 +44,7 @@ export const useRefreshableSelection = () => {
if (!isRefreshable.value) return
if (isAllNodesSelected.value) {
commandStore.execute('Comfy.RefreshNodeDefinitions')
await commandStore.execute('Comfy.RefreshNodeDefinitions')
} else {
await Promise.all(refreshableWidgets.value.map((item) => item.refresh()))
}