chore: resolve yarn.lock conflict

This commit is contained in:
Hydra 2024-04-18 22:27:04 +01:00
commit 671c160e49
8 changed files with 32 additions and 49 deletions

View file

@ -1,5 +1,4 @@
import { format } from "date-fns";
import prettyBytes from "pretty-bytes";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
@ -12,6 +11,7 @@ import { NoEntryIcon, PlusCircleIcon } from "@primer/octicons-react";
import { BinaryNotFoundModal } from "../shared-modals/binary-not-found-modal";
import * as styles from "./hero-panel.css";
import { useDate } from "@renderer/hooks/use-date";
import { formatBytes } from "@renderer/utils";
export interface HeroPanelProps {
game: Game | null;
@ -122,10 +122,10 @@ export function HeroPanel({
const finalDownloadSize = useMemo(() => {
if (!game) return "N/A";
if (game.fileSize) return prettyBytes(game.fileSize);
if (game.fileSize) return formatBytes(game.fileSize);
if (gameDownloading?.fileSize && isGameDownloading)
return prettyBytes(gameDownloading.fileSize);
return formatBytes(gameDownloading.fileSize);
return game.repack?.fileSize ?? "N/A";
}, [game, isGameDownloading, gameDownloading]);
@ -172,7 +172,7 @@ export function HeroPanel({
</>
) : (
<p className={styles.downloadDetailsRow}>
{prettyBytes(gameDownloading?.bytesDownloaded)} /{" "}
{formatBytes(gameDownloading?.bytesDownloaded)} /{" "}
{finalDownloadSize}
<small>
{numPeers} peers / {numSeeds} seeds
@ -192,7 +192,7 @@ export function HeroPanel({
})}
</p>
<p>
{prettyBytes(game.bytesDownloaded)} / {finalDownloadSize}
{formatBytes(game.bytesDownloaded)} / {finalDownloadSize}
</p>
</>
);