fixed: alternative implementation for confirm

`confirm` cannot be used in electron
This commit is contained in:
Dr.Lt.Data
2024-12-31 14:37:03 +09:00
parent 91736ef29d
commit 939cb12670
6 changed files with 120 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
import { api } from "../../scripts/api.js";
import { app } from "../../scripts/app.js";
import { sleep } from "./common.js";
import { sleep, customConfirm } from "./common.js";
async function tryInstallCustomNode(event) {
let msg = '-= [ComfyUI Manager] extension installation request =-\n\n';
@@ -22,8 +22,7 @@ async function tryInstallCustomNode(event) {
alert(msg);
return;
}
let res = confirm(msg);
const res = await customConfirm(msg);
if(res) {
if(event.detail.target.installed == 'Disabled') {
const response = await api.fetchApi(`/customnode/toggle_active`, {