mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-04-17 07:58:38 +02:00
Fix UI display when removing the last task
Clear All button properly shows the "welcome message", but Remove the last task would just result in a blank Preview pane.
This commit is contained in:
parent
347fa0fda1
commit
e64e1a92e6
@ -903,7 +903,7 @@ function createTask(task) {
|
|||||||
taskQueue.splice(idx, 1)
|
taskQueue.splice(idx, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
taskEntry.remove()
|
removeTask(taskEntry)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1047,16 +1047,22 @@ async function stopAllTasks() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeTask(taskToRemove) {
|
||||||
|
taskToRemove.remove()
|
||||||
|
|
||||||
|
if (document.querySelectorAll('.imageTaskContainer').length === 0) {
|
||||||
|
previewTools.style.display = 'none'
|
||||||
|
initialText.style.display = 'block'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
clearAllPreviewsBtn.addEventListener('click', async function() {
|
clearAllPreviewsBtn.addEventListener('click', async function() {
|
||||||
await stopAllTasks()
|
await stopAllTasks()
|
||||||
|
|
||||||
let taskEntries = document.querySelectorAll('.imageTaskContainer')
|
let taskEntries = document.querySelectorAll('.imageTaskContainer')
|
||||||
taskEntries.forEach(task => {
|
taskEntries.forEach(task => {
|
||||||
task.remove()
|
removeTask(task)
|
||||||
})
|
})
|
||||||
|
|
||||||
previewTools.style.display = 'none'
|
|
||||||
initialText.style.display = 'block'
|
|
||||||
})
|
})
|
||||||
|
|
||||||
stopImageBtn.addEventListener('click', async function() {
|
stopImageBtn.addEventListener('click', async function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user