mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-19 00:47:01 +08:00
Prevent Clear List when Delete All
When delete all was clicked and cancelled it still cleared the drawer, fixed
This commit is contained in:
parent
42d6954352
commit
0422274440
@ -210,9 +210,12 @@ app.registerExtension({
|
|||||||
right: "5px",
|
right: "5px",
|
||||||
});
|
});
|
||||||
deleteAllButton.onclick = () => {
|
deleteAllButton.onclick = () => {
|
||||||
api.deleteAllImages();
|
const confirmDelete = confirm("Are you sure you want to delete all images?");
|
||||||
allImages = []
|
if (confirmDelete) {
|
||||||
imageList.replaceChildren(menu, resizeHandle);
|
api.deleteAllImages();
|
||||||
|
allImages = []
|
||||||
|
imageList.replaceChildren(menu, resizeHandle);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
api.getOutput().then(data => {
|
api.getOutput().then(data => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -118,10 +118,7 @@ class ComfyApi extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async deleteAllImages() {
|
async deleteAllImages() {
|
||||||
const confirmDelete = confirm("Are you sure you want to delete all images?");
|
await this.#postItem("delete", { delete: "all" })
|
||||||
if (confirmDelete) {
|
|
||||||
await this.#postItem("delete", { delete: "all" })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
async deleteImage(filename) {
|
async deleteImage(filename) {
|
||||||
await this.#postItem("delete", { delete: filename })
|
await this.#postItem("delete", { delete: filename })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user