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:
Chubby Granny Chaser
2026-01-11 17:14:24 +00:00
parent 2029f861f6
commit f8ba72a0e2
2 changed files with 36 additions and 33 deletions

View File

@@ -783,11 +783,10 @@ export function DownloadGroup({
const actionTypesPromises = completedGames.map(async (game) => { const actionTypesPromises = completedGames.map(async (game) => {
try { try {
const actionType = const actionType = await window.electron.getGameInstallerActionType(
await window.electron.getGameInstallerActionType( game.shop,
game.shop, game.objectId
game.objectId );
);
return { gameId: game.id, actionType }; return { gameId: game.id, actionType };
} catch { } catch {
return { gameId: game.id, actionType: "open-folder" as const }; return { gameId: game.id, actionType: "open-folder" as const };
@@ -937,31 +936,35 @@ export function DownloadGroup({
)} )}
<div className="download-group__simple-actions"> <div className="download-group__simple-actions">
{game.download?.progress === 1 && (() => { {game.download?.progress === 1 &&
const actionType = gameActionTypes[game.id] || "open-folder"; (() => {
const isInstall = actionType === "install"; const actionType =
gameActionTypes[game.id] || "open-folder";
return ( const isInstall = actionType === "install";
<Button
theme="primary" return (
onClick={() => openGameInstaller(game.shop, game.objectId)} <Button
disabled={isGameDeleting(game.id)} theme="primary"
className="download-group__simple-action-btn" onClick={() =>
> openGameInstaller(game.shop, game.objectId)
{isInstall ? ( }
<> disabled={isGameDeleting(game.id)}
<DownloadIcon size={16} /> className="download-group__simple-action-btn"
{t("install")} >
</> {isInstall ? (
) : ( <>
<> <DownloadIcon size={16} />
<Folder size={16} /> {t("install")}
{tGameDetails("open_folder")} </>
</> ) : (
)} <>
</Button> <Folder size={16} />
); {tGameDetails("open_folder")}
})()} </>
)}
</Button>
);
})()}
{isQueuedGroup && game.download?.progress !== 1 && ( {isQueuedGroup && game.download?.progress !== 1 && (
<Button <Button
theme="primary" theme="primary"

View File

@@ -260,10 +260,10 @@ export function ProfileHero() {
if (userProfile?.id) { if (userProfile?.id) {
navigator.clipboard.writeText(userProfile.id); navigator.clipboard.writeText(userProfile.id);
setIsCopied(true); setIsCopied(true);
const startTime = performance.now(); const startTime = performance.now();
const duration = 1200; // 1.2 seconds const duration = 1200; // 1.2 seconds
const animate = (currentTime: number) => { const animate = (currentTime: number) => {
const elapsed = currentTime - startTime; const elapsed = currentTime - startTime;
if (elapsed < duration) { if (elapsed < duration) {
@@ -272,7 +272,7 @@ export function ProfileHero() {
setIsCopied(false); setIsCopied(false);
} }
}; };
requestAnimationFrame(animate); requestAnimationFrame(animate);
} }
}, [userProfile]); }, [userProfile]);