mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
code adjustment
This commit is contained in:
parent
cc9a38acf8
commit
ca73316ee9
1 changed files with 4 additions and 9 deletions
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue