mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 13:24:58 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -44,12 +44,20 @@ export function resolveAuthProfileSource(_profileId: string): AuthProfileSource
|
||||
}
|
||||
|
||||
export function formatRemainingShort(remainingMs?: number): string {
|
||||
if (remainingMs === undefined || Number.isNaN(remainingMs)) return "unknown";
|
||||
if (remainingMs <= 0) return "0m";
|
||||
if (remainingMs === undefined || Number.isNaN(remainingMs)) {
|
||||
return "unknown";
|
||||
}
|
||||
if (remainingMs <= 0) {
|
||||
return "0m";
|
||||
}
|
||||
const minutes = Math.max(1, Math.round(remainingMs / 60_000));
|
||||
if (minutes < 60) return `${minutes}m`;
|
||||
if (minutes < 60) {
|
||||
return `${minutes}m`;
|
||||
}
|
||||
const hours = Math.round(minutes / 60);
|
||||
if (hours < 48) return `${hours}h`;
|
||||
if (hours < 48) {
|
||||
return `${hours}h`;
|
||||
}
|
||||
const days = Math.round(hours / 24);
|
||||
return `${days}d`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user