fix: auto-resuming download isnt working after restart

This commit is contained in:
Moyasee
2025-11-30 08:05:45 +02:00
parent 058a148c7f
commit 9779aed8c1
3 changed files with 11 additions and 6 deletions

View File

@@ -13,7 +13,12 @@ const resumeGameDownload = async (
const download = await downloadsSublevel.get(gameKey);
if (download?.status === "paused") {
// Allow resuming if status is "paused" OR "active" (for cases where app was closed during download)
if (
download &&
(download.status === "paused" || download.status === "active") &&
download.progress !== 1
) {
await DownloadManager.pauseDownload();
for await (const [key, value] of downloadsSublevel.iterator()) {