code adjustment

This commit is contained in:
Zamitto 2024-06-08 11:33:59 -03:00
parent cc9a38acf8
commit ca73316ee9

View file

@ -35,12 +35,12 @@ export function GameOptionsModal({
cancelDownload, cancelDownload,
} = useDownload(); } = useDownload();
const deleting = game ? isGameDeleting(game?.id) : false; const deleting = isGameDeleting(game.id);
const { lastPacket } = useDownload(); const { lastPacket } = useDownload();
const isGameDownloading = const isGameDownloading =
game?.status === "active" && lastPacket?.game.id === game?.id; game.status === "active" && lastPacket?.game.id === game.id;
const handleRemoveGameFromLibrary = async () => { const handleRemoveGameFromLibrary = async () => {
if (isGameDownloading) { if (isGameDownloading) {
@ -129,15 +129,10 @@ export function GameOptionsModal({
type="button" type="button"
theme="outline" theme="outline"
onClick={handleOpenGameExecutablePath} onClick={handleOpenGameExecutablePath}
disabled={!game.executablePath}
> >
{t("open_folder")} {t("open_folder")}
</Button> </Button>
<Button <Button onClick={handleCreateShortcut} theme="outline">
onClick={handleCreateShortcut}
theme="outline"
disabled={deleting || !game.executablePath}
>
{t("create_shortcut")} {t("create_shortcut")}
</Button> </Button>
</div> </div>
@ -161,7 +156,7 @@ export function GameOptionsModal({
<Button <Button
onClick={handleOpenDownloadFolder} onClick={handleOpenDownloadFolder}
theme="outline" theme="outline"
disabled={deleting || !game.downloadPath} disabled={deleting}
> >
{t("open_download_location")} {t("open_download_location")}
</Button> </Button>