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) {
|
||||
let seconds = inputSeconds;
|
||||
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));
|
||||
seconds %= 24 * 60 * 60; // Remaining seconds after subtracting days
|
||||
seconds %= 24 * 60 * 60; // Remaining seconds after subtracting days
|
||||
|
||||
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 remainingSeconds = seconds % 60;
|
||||
|
||||
let result = '';
|
||||
let result = "";
|
||||
if (years > 0) result = `over ${years}y`;
|
||||
else if (days > 0) result = `over ${days}d`;
|
||||
else if (hours > 0) result = `${hours}h ${minutes}m`;
|
||||
@ -30,7 +30,6 @@ function formatTimeLeft(inputSeconds) {
|
||||
return result.trim();
|
||||
}
|
||||
|
||||
|
||||
export default function Component({ service }) {
|
||||
const { t } = useTranslation();
|
||||
const { widget } = service;
|
||||
@ -83,7 +82,7 @@ export default function Component({ service }) {
|
||||
{enableLeechProgress &&
|
||||
leechTorrents.map((queueEntry) => (
|
||||
<QueueEntry
|
||||
progress={(queueEntry.progress) * 100}
|
||||
progress={queueEntry.progress * 100}
|
||||
timeLeft={formatTimeLeft(queueEntry.eta)}
|
||||
title={queueEntry.name}
|
||||
activity={queueEntry.state}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user