mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-26 20:38:20 +02:00
Merge pull request #564 from patriceac/Fix-UI-display-when-removing-the-last-task
Fix UI display when removing the last task
This commit is contained in:
commit
321e5f1ed6
@ -901,7 +901,7 @@ function createTask(task) {
|
|||||||
taskQueue.splice(idx, 1)
|
taskQueue.splice(idx, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
taskEntry.remove()
|
removeTask(taskEntry)
|
||||||
}
|
}
|
||||||
})})
|
})})
|
||||||
|
|
||||||
@ -1045,16 +1045,20 @@ async function stopAllTasks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeTask(taskToRemove) {
|
||||||
|
taskToRemove.remove()
|
||||||
|
|
||||||
|
if (document.querySelector('.imageTaskContainer') === null) {
|
||||||
|
previewTools.style.display = 'none'
|
||||||
|
initialText.style.display = 'block'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clearAllPreviewsBtn.addEventListener('click', (e) => { shiftOrConfirm(e, "Are you sure? Remove all results and tasks from the results pane?", async function() {
|
clearAllPreviewsBtn.addEventListener('click', (e) => { shiftOrConfirm(e, "Are you sure? Remove all results and tasks from the results pane?", async function() {
|
||||||
await stopAllTasks()
|
await stopAllTasks()
|
||||||
|
|
||||||
let taskEntries = document.querySelectorAll('.imageTaskContainer')
|
let taskEntries = document.querySelectorAll('.imageTaskContainer')
|
||||||
taskEntries.forEach(task => {
|
taskEntries.forEach(removeTask)
|
||||||
task.remove()
|
|
||||||
})
|
|
||||||
|
|
||||||
previewTools.style.display = 'none'
|
|
||||||
initialText.style.display = 'block'
|
|
||||||
})})
|
})})
|
||||||
|
|
||||||
stopImageBtn.addEventListener('click', (e) => { shiftOrConfirm(e, "Are you sure? Do you want to stop all the tasks?", async function(e) {
|
stopImageBtn.addEventListener('click', (e) => { shiftOrConfirm(e, "Are you sure? Do you want to stop all the tasks?", async function(e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user