Add toast message on refresh button click (#492)

This commit is contained in:
Chenlei Hu
2024-08-17 13:11:47 -04:00
committed by GitHub
parent 966b1dd057
commit 5ba524fd94
3 changed files with 52 additions and 6 deletions

View File

@@ -45,6 +45,8 @@ import { Vector2 } from '@comfyorg/litegraph'
import _ from 'lodash'
import { showLoadWorkflowWarning } from '@/services/dialogService'
import { useSettingStore } from '@/stores/settingStore'
import { useToastStore } from '@/stores/toastStore'
import type { ToastMessageOptions } from 'primevue/toast'
export const ANIM_PREVIEW_WIDGET = '$$comfy_animation_preview'
@@ -2851,6 +2853,13 @@ export class ComfyApp {
* Refresh combo list on whole nodes
*/
async refreshComboInNodes() {
const requestToastMessage: ToastMessageOptions = {
severity: 'info',
summary: 'Update',
detail: 'Update requested'
}
if (this.vueAppReady) useToastStore().add(requestToastMessage)
const defs = await api.getNodeDefs()
for (const nodeId in defs) {
@@ -2888,6 +2897,16 @@ export class ComfyApp {
}
await this.#invokeExtensionsAsync('refreshComboInNodes', defs)
if (this.vueAppReady) {
useToastStore().remove(requestToastMessage)
useToastStore().add({
severity: 'success',
summary: 'Updated',
detail: 'Node definitions updated',
life: 1000
})
}
}
resetView() {