chore: resolve yarn.lock conflict

This commit is contained in:
Hydra 2024-04-18 22:27:04 +01:00
commit a7da2108ec
No known key found for this signature in database
8 changed files with 32 additions and 49 deletions

View file

@ -1,4 +1,3 @@
import prettyBytes from "pretty-bytes";
import { useTranslation } from "react-i18next";
import { useNavigate } from "react-router-dom";
@ -11,6 +10,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
import { BinaryNotFoundModal } from "../shared-modals/binary-not-found-modal";
import * as styles from "./downloads.css";
import { DeleteModal } from "./delete-modal";
import { formatBytes } from "@renderer/utils";
export function Downloads() {
const { library, updateLibrary } = useLibrary();
@ -61,10 +61,10 @@ export function Downloads() {
const isGameDownloading = isDownloading && gameDownloading?.id === game?.id;
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";
};
@ -87,7 +87,7 @@ export function Downloads() {
) : (
<>
<p>
{prettyBytes(gameDownloading?.bytesDownloaded)} /{" "}
{formatBytes(gameDownloading?.bytesDownloaded)} /{" "}
{finalDownloadSize}
</p>
<p>

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>
</>
);

View file

@ -1,6 +1,5 @@
import { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import prettyBytes from "pretty-bytes";
import { Button, Modal, TextField } from "@renderer/components";
import type { GameRepack, ShopDetails } from "@types";
@ -10,6 +9,7 @@ import * as styles from "./repacks-modal.css";
import type { DiskSpace } from "check-disk-space";
import { format } from "date-fns";
import { SPACING_UNIT } from "@renderer/theme.css";
import { formatBytes } from "@renderer/utils";
export interface RepacksModalProps {
visible: boolean;
@ -66,7 +66,7 @@ export function RepacksModal({
visible={visible}
title={`${gameDetails.name} Repacks`}
description={t("space_left_on_disk", {
space: prettyBytes(diskFreeSpace?.free ?? 0),
space: formatBytes(diskFreeSpace?.free ?? 0),
})}
onClose={onClose}
>