Skip to content

Commit

Permalink
Fix filesize breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
baptistecdr committed Oct 14, 2023
1 parent 2b2082d commit 120277a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/popup/components/server-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "./server-tab.css";
import Aria2 from "aria2";
import { Button, Col, Container, Row } from "react-bootstrap";
import { plainToInstance } from "class-transformer";
import { filesize } from "filesize";
import { filesize, FileSizeOptionsBase } from "filesize";
import { Oval } from "react-loader-spinner";
import { Task } from "../models/task";
import GlobalStat from "../models/global-stat";
Expand Down Expand Up @@ -50,7 +50,7 @@ function ServerTab({ setExtensionOptions, extensionOptions, server }: Props) {
const [showAddTask, setShowAddTask] = useState(false);
const [showQuickOptions, setShowQuickOptions] = useState(false);
const [defaultMessage, setDefaultMessage] = useState(i18n("serverNoTasks"));
const fileSizeBase = { base: 2 };
const fileSizeBase = { base: 2 } as FileSizeOptionsBase;

function onClickPurge() {
aria2.call("aria2.purgeDownloadResult");
Expand Down
4 changes: 2 additions & 2 deletions src/popup/components/server-task.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Col, OverlayTrigger, Row, Tooltip } from "react-bootstrap";
import { Duration } from "luxon";
import browser from "webextension-polyfill";
import { filesize } from "filesize";
import { filesize, FileSizeOptionsBase } from "filesize";
import { useEffect, useState } from "react";
import { Task } from "../models/task";
import basename from "../../models/basename";
Expand All @@ -24,7 +24,7 @@ async function getFilename(task: Task): Promise<string> {
}

function ServerTask({ task, aria2 }: Props) {
const filesizeParameters = { base: 2 };
const filesizeParameters = { base: 2 } as FileSizeOptionsBase;
const [filename, setFilename] = useState("");

useEffect(() => {
Expand Down

0 comments on commit 120277a

Please sign in to comment.