Merge pull request #918 from JeLuF/downloadall

Download all: Fix to download more than 10 images
This commit is contained in:
cmdr2 2023-02-21 08:41:50 +05:30 committed by GitHub
commit 7b85e50604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1163,14 +1163,15 @@ clearAllPreviewsBtn.addEventListener('click', (e) => { shiftOrConfirm(e, "Clear
})}) })})
saveAllImagesBtn.addEventListener('click', (e) => { saveAllImagesBtn.addEventListener('click', (e) => {
let i = 0
document.querySelectorAll(".imageTaskContainer").forEach(container => { document.querySelectorAll(".imageTaskContainer").forEach(container => {
let req = htmlTaskMap.get(container) let req = htmlTaskMap.get(container)
container.querySelectorAll(".imgContainer img").forEach(img => { container.querySelectorAll(".imgContainer img").forEach(img => {
if (img.closest('.imgItem').style.display === 'none') { if (img.closest('.imgItem').style.display === 'none') {
return return
} }
setTimeout(() => {onDownloadImageClick(req, img)}, i*200)
onDownloadImageClick(req.reqBody, img) i = i+1
}) })
}) })
}) })