Fix linting errors
This commit is contained in:
parent
a301fd7228
commit
79f5362d03
@ -9,18 +9,18 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
|
|||||||
function formatTimeLeft(inputSeconds) {
|
function formatTimeLeft(inputSeconds) {
|
||||||
let seconds = inputSeconds;
|
let seconds = inputSeconds;
|
||||||
const years = Math.floor(seconds / (365 * 24 * 60 * 60));
|
const years = Math.floor(seconds / (365 * 24 * 60 * 60));
|
||||||
seconds %= 365 * 24 * 60 * 60; // Remaining seconds after subtracting years
|
seconds %= 365 * 24 * 60 * 60; // Remaining seconds after subtracting years
|
||||||
|
|
||||||
const days = Math.floor(seconds / (24 * 60 * 60));
|
const days = Math.floor(seconds / (24 * 60 * 60));
|
||||||
seconds %= 24 * 60 * 60; // Remaining seconds after subtracting days
|
seconds %= 24 * 60 * 60; // Remaining seconds after subtracting days
|
||||||
|
|
||||||
const hours = Math.floor(seconds / 3600);
|
const hours = Math.floor(seconds / 3600);
|
||||||
seconds %= 3600; // Remaining seconds after subtracting hours
|
seconds %= 3600; // Remaining seconds after subtracting hours
|
||||||
|
|
||||||
const minutes = Math.floor(seconds / 60);
|
const minutes = Math.floor(seconds / 60);
|
||||||
const remainingSeconds = seconds % 60;
|
const remainingSeconds = seconds % 60;
|
||||||
|
|
||||||
let result = '';
|
let result = "";
|
||||||
if (years > 0) result = `over ${years}y`;
|
if (years > 0) result = `over ${years}y`;
|
||||||
else if (days > 0) result = `over ${days}d`;
|
else if (days > 0) result = `over ${days}d`;
|
||||||
else if (hours > 0) result = `${hours}h ${minutes}m`;
|
else if (hours > 0) result = `${hours}h ${minutes}m`;
|
||||||
@ -30,7 +30,6 @@ function formatTimeLeft(inputSeconds) {
|
|||||||
return result.trim();
|
return result.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default function Component({ service }) {
|
export default function Component({ service }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
@ -83,7 +82,7 @@ export default function Component({ service }) {
|
|||||||
{enableLeechProgress &&
|
{enableLeechProgress &&
|
||||||
leechTorrents.map((queueEntry) => (
|
leechTorrents.map((queueEntry) => (
|
||||||
<QueueEntry
|
<QueueEntry
|
||||||
progress={(queueEntry.progress) * 100}
|
progress={queueEntry.progress * 100}
|
||||||
timeLeft={formatTimeLeft(queueEntry.eta)}
|
timeLeft={formatTimeLeft(queueEntry.eta)}
|
||||||
title={queueEntry.name}
|
title={queueEntry.name}
|
||||||
activity={queueEntry.state}
|
activity={queueEntry.state}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user