mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-17 01:30:50 +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",
|
||||
});
|
||||
deleteAllButton.onclick = () => {
|
||||
api.deleteAllImages();
|
||||
allImages = []
|
||||
imageList.replaceChildren(menu, resizeHandle);
|
||||
const confirmDelete = confirm("Are you sure you want to delete all images?");
|
||||
if (confirmDelete) {
|
||||
api.deleteAllImages();
|
||||
allImages = []
|
||||
imageList.replaceChildren(menu, resizeHandle);
|
||||
}
|
||||
};
|
||||
api.getOutput().then(data => {
|
||||
try {
|
||||
|
||||
@ -118,10 +118,7 @@ class ComfyApi extends EventTarget {
|
||||
}
|
||||
|
||||
async deleteAllImages() {
|
||||
const confirmDelete = confirm("Are you sure you want to delete all images?");
|
||||
if (confirmDelete) {
|
||||
await this.#postItem("delete", { delete: "all" })
|
||||
}
|
||||
await this.#postItem("delete", { delete: "all" })
|
||||
}
|
||||
async deleteImage(filename) {
|
||||
await this.#postItem("delete", { delete: filename })
|
||||
|
||||
Loading…
Reference in New Issue
Block a user