Merge pull request #1044 from rommapp/romm-1012

[ROMM-1012] Fix multi-file download in gakllery view
This commit is contained in:
Georges-Antoine Assi
2024-08-03 19:52:22 -04:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -128,8 +128,10 @@ async function removeFromFavourites() {
}
function onDownload() {
romsStore.selectedRoms.forEach((rom) => {
romApi.downloadRom({ rom });
romsStore.selectedRoms.forEach((rom, index) => {
setTimeout(() => {
romApi.downloadRom({ rom });
}, index * 100); // Prevents the download from being blocked by the browser
});
}
</script>

View File

@@ -106,7 +106,10 @@ async function downloadRom({
}) {
const a = document.createElement("a");
a.href = getDownloadLink({ rom, files });
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
// Only connect socket if multi-file download
if (rom.multi && files.length > 1) {