mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2026-05-24 16:49:11 +08:00
Make set node error an alert again, but throttled
This commit is contained in:
parent
004c4120e8
commit
2acf45063c
@ -25,7 +25,15 @@ function setColorAndBgColor(type) {
|
|||||||
// Handle the default case if needed
|
// Handle the default case if needed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let isAlertShown = false;
|
||||||
|
|
||||||
|
function showAlertWithThrottle(message, delay) {
|
||||||
|
if (!isAlertShown) {
|
||||||
|
isAlertShown = true;
|
||||||
|
alert(message);
|
||||||
|
setTimeout(() => isAlertShown = false, delay);
|
||||||
|
}
|
||||||
|
}
|
||||||
app.registerExtension({
|
app.registerExtension({
|
||||||
name: "SetNode",
|
name: "SetNode",
|
||||||
registerCustomNodes() {
|
registerCustomNodes() {
|
||||||
@ -322,7 +330,7 @@ app.registerExtension({
|
|||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
const errorMessage = "No SetNode found for " + this.widgets[0].value + "(" + this.type + ")";
|
const errorMessage = "No SetNode found for " + this.widgets[0].value + "(" + this.type + ")";
|
||||||
console.log(errorMessage);
|
showAlertWithThrottle(errorMessage, 5000);
|
||||||
throw new Error(errorMessage);
|
throw new Error(errorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user