mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
Move queueStore update from QueueSidebarTab to GraphView (#2278)
This commit is contained in:
@@ -99,7 +99,7 @@ import type { MenuItem } from 'primevue/menuitem'
|
|||||||
import ProgressSpinner from 'primevue/progressspinner'
|
import ProgressSpinner from 'primevue/progressspinner'
|
||||||
import { useConfirm } from 'primevue/useconfirm'
|
import { useConfirm } from 'primevue/useconfirm'
|
||||||
import { useToast } from 'primevue/usetoast'
|
import { useToast } from 'primevue/usetoast'
|
||||||
import { computed, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue'
|
import { computed, ref, shallowRef, watch } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
|
import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
|
||||||
@@ -194,10 +194,6 @@ const confirmRemoveAll = (event: Event) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const onStatus = async () => {
|
|
||||||
await queueStore.update()
|
|
||||||
}
|
|
||||||
|
|
||||||
const menu = ref(null)
|
const menu = ref(null)
|
||||||
const menuTargetTask = ref<TaskItemImpl | null>(null)
|
const menuTargetTask = ref<TaskItemImpl | null>(null)
|
||||||
const menuTargetNode = ref<ComfyNode | null>(null)
|
const menuTargetNode = ref<ComfyNode | null>(null)
|
||||||
@@ -267,13 +263,4 @@ watch(allTasks, () => {
|
|||||||
const newIndex = galleryActiveIndex.value + lengthChange
|
const newIndex = galleryActiveIndex.value + lengthChange
|
||||||
galleryActiveIndex.value = Math.max(0, newIndex)
|
galleryActiveIndex.value = Math.max(0, newIndex)
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
api.addEventListener('status', onStatus)
|
|
||||||
queueStore.update()
|
|
||||||
})
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
api.removeEventListener('status', onStatus)
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ const toast = useToast()
|
|||||||
const settingStore = useSettingStore()
|
const settingStore = useSettingStore()
|
||||||
const executionStore = useExecutionStore()
|
const executionStore = useExecutionStore()
|
||||||
const colorPaletteStore = useColorPaletteStore()
|
const colorPaletteStore = useColorPaletteStore()
|
||||||
|
const queueStore = useQueueStore()
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => colorPaletteStore.completedActivePalette,
|
() => colorPaletteStore.completedActivePalette,
|
||||||
@@ -110,9 +111,7 @@ watchEffect(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
useQueueStore().maxHistoryItems = settingStore.get(
|
queueStore.maxHistoryItems = settingStore.get('Comfy.Queue.MaxHistoryItems')
|
||||||
'Comfy.Queue.MaxHistoryItems'
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
@@ -126,8 +125,9 @@ const init = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const queuePendingTaskCountStore = useQueuePendingTaskCountStore()
|
const queuePendingTaskCountStore = useQueuePendingTaskCountStore()
|
||||||
const onStatus = (e: CustomEvent<StatusWsMessageStatus>) => {
|
const onStatus = async (e: CustomEvent<StatusWsMessageStatus>) => {
|
||||||
queuePendingTaskCountStore.update(e)
|
queuePendingTaskCountStore.update(e)
|
||||||
|
await queueStore.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
const reconnectingMessage: ToastMessageOptions = {
|
const reconnectingMessage: ToastMessageOptions = {
|
||||||
|
|||||||
Reference in New Issue
Block a user