mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-19 19:03:51 +00:00
Fix delete sometimes not properly refreshing queue state.
This commit is contained in:
parent
d71d0c88e5
commit
6e40393b6b
@ -534,7 +534,7 @@ document.addEventListener('paste', e=>{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function deleteQueueElement(delete_id) {
|
function deleteQueueElement(delete_id, then) {
|
||||||
fetch('/queue', {
|
fetch('/queue', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
@ -544,6 +544,7 @@ function deleteQueueElement(delete_id) {
|
|||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
then();
|
||||||
})
|
})
|
||||||
.catch(error => console.error(error))
|
.catch(error => console.error(error))
|
||||||
}
|
}
|
||||||
@ -586,8 +587,7 @@ function loadQueue() {
|
|||||||
button.style.fontSize = "10px";
|
button.style.fontSize = "10px";
|
||||||
button.delete_id = id;
|
button.delete_id = id;
|
||||||
button.onclick = function(event) {
|
button.onclick = function(event) {
|
||||||
deleteQueueElement(event.target.delete_id);
|
deleteQueueElement(event.target.delete_id, loadQueue);
|
||||||
loadQueue();
|
|
||||||
};
|
};
|
||||||
append_to_element.appendChild(button);
|
append_to_element.appendChild(button);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user