diff --git a/packages/widgets/src/downloads/component.tsx b/packages/widgets/src/downloads/component.tsx index 041495bc9..d2b3b5f28 100644 --- a/packages/widgets/src/downloads/component.tsx +++ b/packages/widgets/src/downloads/component.tsx @@ -205,8 +205,9 @@ export default function DownloadClientsWidget({ const aVal = a[accessor] ?? 0; const bVal = b[accessor] ?? 0; if (accessor === "time") { - const toKey = (time: number) => (time === 0 ? Infinity : time); - return (toKey(aVal as number) - toKey(bVal as number)) * dir; + const aTime = (aVal as number) === 0 ? Infinity : (aVal as number); + const bTime = (bVal as number) === 0 ? Infinity : (bVal as number); + return (aTime - bTime) * dir; } if (typeof aVal === "string" && typeof bVal === "string") return aVal.localeCompare(bVal) * dir; if (typeof aVal === "number" && typeof bVal === "number") return (aVal - bVal) * dir; @@ -862,7 +863,7 @@ function RowContextMenu({ state, onClose, t }: {