Replace window.alert with toast alert (#1112)

* Replace window.alert with toast alert

* Mock jest
This commit is contained in:
Chenlei Hu
2024-10-04 22:00:44 -04:00
committed by GitHub
parent 2649d72d3f
commit 4cc69544b5
13 changed files with 57 additions and 30 deletions

View File

@@ -8,6 +8,7 @@ import {
type LGraphNode,
type LGraphNodeConstructor
} from '@comfyorg/litegraph'
import { useToastStore } from '@/stores/toastStore'
const ORDER: symbol = Symbol()
const PREFIX = 'workflow'
@@ -396,7 +397,7 @@ export class ManageGroupDialog extends ComfyDialog<HTMLDialogElement> {
(n) => n.type === `${PREFIX}${SEPARATOR}` + this.selectedGroup
)
if (node) {
alert(
useToastStore().addAlert(
'This group node is in use in the current workflow, please first remove these.'
)
return