feat: disabling button when installing

This commit is contained in:
Chubby Granny Chaser
2025-04-06 23:50:00 +01:00
parent cc505acbdc
commit e7427b8184

View File

@@ -138,6 +138,8 @@ export class DownloadManager {
);
}
const shouldExtract = download.automaticallyExtract;
if (progress === 1 && download) {
publishDownloadCompleteNotification(game);
@@ -150,10 +152,9 @@ export class DownloadManager {
status: "seeding",
shouldSeed: true,
queued: false,
extracting: shouldExtract,
});
} else {
const shouldExtract = download.automaticallyExtract;
await downloadsSublevel.put(gameId, {
...download,
status: "complete",
@@ -162,32 +163,32 @@ export class DownloadManager {
extracting: shouldExtract,
});
if (shouldExtract) {
const gameFilesManager = new GameFilesManager(
game.shop,
game.objectId
);
if (
FILE_EXTENSIONS_TO_EXTRACT.some((ext) =>
download.folderName?.endsWith(ext)
)
) {
gameFilesManager.extractDownloadedFile();
} else {
gameFilesManager
.extractFilesInDirectory(
path.join(download.downloadPath, download.folderName!)
)
.then(() => {
gameFilesManager.setExtractionComplete();
});
}
}
this.cancelDownload(gameId);
}
if (shouldExtract) {
const gameFilesManager = new GameFilesManager(
game.shop,
game.objectId
);
if (
FILE_EXTENSIONS_TO_EXTRACT.some((ext) =>
download.folderName?.endsWith(ext)
)
) {
gameFilesManager.extractDownloadedFile();
} else {
gameFilesManager
.extractFilesInDirectory(
path.join(download.downloadPath, download.folderName!)
)
.then(() => {
gameFilesManager.setExtractionComplete();
});
}
}
const downloads = await downloadsSublevel
.values()
.all()