fix: fixing seeding on level

This commit is contained in:
Chubby Granny Chaser 2025-02-03 13:50:34 +00:00
parent 7e54a6d0a9
commit e85a568e6e
No known key found for this signature in database
3 changed files with 7 additions and 5 deletions

View file

@ -15,6 +15,7 @@ const pauseGameSeed = async (
await downloadsSublevel.put(downloadKey, { await downloadsSublevel.put(downloadKey, {
...download, ...download,
status: "complete",
shouldSeed: false, shouldSeed: false,
}); });

View file

@ -14,6 +14,7 @@ const resumeGameSeed = async (
await downloadsSublevel.put(levelKeys.game(shop, objectId), { await downloadsSublevel.put(levelKeys.game(shop, objectId), {
...download, ...download,
status: "seeding",
shouldSeed: true, shouldSeed: true,
}); });

View file

@ -173,7 +173,7 @@ export function DownloadGroup({
const deleting = isGameDeleting(game.id); const deleting = isGameDeleting(game.id);
if (download?.progress === 1) { if (game.download?.progress === 1) {
return [ return [
{ {
label: t("install"), label: t("install"),
@ -188,8 +188,8 @@ export function DownloadGroup({
disabled: deleting, disabled: deleting,
icon: <UnlinkIcon />, icon: <UnlinkIcon />,
show: show:
download.status === "seeding" && game.download?.status === "seeding" &&
download.downloader === Downloader.Torrent, game.download?.downloader === Downloader.Torrent,
onClick: () => { onClick: () => {
pauseSeeding(game.shop, game.objectId); pauseSeeding(game.shop, game.objectId);
}, },
@ -199,8 +199,8 @@ export function DownloadGroup({
disabled: deleting, disabled: deleting,
icon: <LinkIcon />, icon: <LinkIcon />,
show: show:
download.status !== "seeding" && game.download?.status !== "seeding" &&
download.downloader === Downloader.Torrent, game.download?.downloader === Downloader.Torrent,
onClick: () => { onClick: () => {
resumeSeeding(game.shop, game.objectId); resumeSeeding(game.shop, game.objectId);
}, },