mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-15 16:33:02 -03:00
refactor: clean up code formatting and improve readability in DownloadGroup and ProfileHero components
- Adjusted indentation and spacing for better code clarity in DownloadGroup. - Removed unnecessary blank lines in ProfileHero to streamline the code structure. - Ensured consistent formatting across both components.
This commit is contained in:
@@ -783,11 +783,10 @@ export function DownloadGroup({
|
||||
|
||||
const actionTypesPromises = completedGames.map(async (game) => {
|
||||
try {
|
||||
const actionType =
|
||||
await window.electron.getGameInstallerActionType(
|
||||
game.shop,
|
||||
game.objectId
|
||||
);
|
||||
const actionType = await window.electron.getGameInstallerActionType(
|
||||
game.shop,
|
||||
game.objectId
|
||||
);
|
||||
return { gameId: game.id, actionType };
|
||||
} catch {
|
||||
return { gameId: game.id, actionType: "open-folder" as const };
|
||||
@@ -937,31 +936,35 @@ export function DownloadGroup({
|
||||
)}
|
||||
|
||||
<div className="download-group__simple-actions">
|
||||
{game.download?.progress === 1 && (() => {
|
||||
const actionType = gameActionTypes[game.id] || "open-folder";
|
||||
const isInstall = actionType === "install";
|
||||
{game.download?.progress === 1 &&
|
||||
(() => {
|
||||
const actionType =
|
||||
gameActionTypes[game.id] || "open-folder";
|
||||
const isInstall = actionType === "install";
|
||||
|
||||
return (
|
||||
<Button
|
||||
theme="primary"
|
||||
onClick={() => openGameInstaller(game.shop, game.objectId)}
|
||||
disabled={isGameDeleting(game.id)}
|
||||
className="download-group__simple-action-btn"
|
||||
>
|
||||
{isInstall ? (
|
||||
<>
|
||||
<DownloadIcon size={16} />
|
||||
{t("install")}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Folder size={16} />
|
||||
{tGameDetails("open_folder")}
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
})()}
|
||||
return (
|
||||
<Button
|
||||
theme="primary"
|
||||
onClick={() =>
|
||||
openGameInstaller(game.shop, game.objectId)
|
||||
}
|
||||
disabled={isGameDeleting(game.id)}
|
||||
className="download-group__simple-action-btn"
|
||||
>
|
||||
{isInstall ? (
|
||||
<>
|
||||
<DownloadIcon size={16} />
|
||||
{t("install")}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Folder size={16} />
|
||||
{tGameDetails("open_folder")}
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
})()}
|
||||
{isQueuedGroup && game.download?.progress !== 1 && (
|
||||
<Button
|
||||
theme="primary"
|
||||
|
||||
Reference in New Issue
Block a user