diff --git a/src/components/actionbar/ComfyRunButton/ComfyQueueButton.vue b/src/components/actionbar/ComfyRunButton/ComfyQueueButton.vue index eddc9c3f7..a6359763e 100644 --- a/src/components/actionbar/ComfyRunButton/ComfyQueueButton.vue +++ b/src/components/actionbar/ComfyRunButton/ComfyQueueButton.vue @@ -8,7 +8,7 @@ showDelay: 600 }" class="comfyui-queue-button" - :label="activeQueueModeMenuItem.label" + :label="String(activeQueueModeMenuItem?.label ?? '')" severity="primary" size="small" :model="queueModeMenuItems" @@ -33,7 +33,7 @@ value: item.tooltip, showDelay: 600 }" - :label="String(item.label)" + :label="String(item.label ?? '')" :icon="item.icon" :severity="item.key === queueMode ? 'primary' : 'secondary'" size="small" @@ -82,6 +82,7 @@ import { storeToRefs } from 'pinia' import Button from 'primevue/button' import ButtonGroup from 'primevue/buttongroup' +import type { MenuItem } from 'primevue/menuitem' import SplitButton from 'primevue/splitbutton' import { computed } from 'vue' import { useI18n } from 'vue-i18n' @@ -102,36 +103,45 @@ const queueCountStore = storeToRefs(useQueuePendingTaskCountStore()) const { mode: queueMode } = storeToRefs(useQueueSettingsStore()) const { t } = useI18n() -const queueModeMenuItemLookup = computed(() => ({ - disabled: { - key: 'disabled', - label: t('menu.run'), - tooltip: t('menu.disabledTooltip'), - command: () => { - queueMode.value = 'disabled' - } - }, - instant: { - key: 'instant', - label: `${t('menu.run')} (${t('menu.instant')})`, - tooltip: t('menu.instantTooltip'), - command: () => { - queueMode.value = 'instant' - } - }, - change: { - key: 'change', - label: `${t('menu.run')} (${t('menu.onChange')})`, - tooltip: t('menu.onChangeTooltip'), - command: () => { - queueMode.value = 'change' +const queueModeMenuItemLookup = computed(() => { + const items: Record = { + disabled: { + key: 'disabled', + label: t('menu.run'), + tooltip: t('menu.disabledTooltip'), + command: () => { + queueMode.value = 'disabled' + } + }, + change: { + key: 'change', + label: `${t('menu.run')} (${t('menu.onChange')})`, + tooltip: t('menu.onChangeTooltip'), + command: () => { + queueMode.value = 'change' + } } } -})) + if (!isCloud) { + items.instant = { + key: 'instant', + label: `${t('menu.run')} (${t('menu.instant')})`, + tooltip: t('menu.instantTooltip'), + command: () => { + queueMode.value = 'instant' + } + } + } + return items +}) -const activeQueueModeMenuItem = computed( - () => queueModeMenuItemLookup.value[queueMode.value] -) +const activeQueueModeMenuItem = computed(() => { + // Fallback to disabled mode if current mode is not available (e.g., instant mode in cloud) + return ( + queueModeMenuItemLookup.value[queueMode.value] || + queueModeMenuItemLookup.value.disabled + ) +}) const queueModeMenuItems = computed(() => Object.values(queueModeMenuItemLookup.value) )