Maximus upgradus
CodexBar Mobile Build / build-android (push) Failing after 1m38s
CodexBar Mobile Build / release (push) Has been skipped

This commit is contained in:
2026-06-24 20:16:34 +02:00
parent d5b0f9c833
commit ba7d957155
20 changed files with 1192 additions and 642 deletions
+16 -6
View File
@@ -5,11 +5,17 @@ export function formatResetCountdown(resetAtSeconds: number): string {
if (diffSeconds <= 0) return "resetting now";
if (diffSeconds < 60) return "resets in <1m";
const hours = Math.floor(diffSeconds / 3600);
const totalHours = Math.floor(diffSeconds / 3600);
const minutes = Math.floor((diffSeconds % 3600) / 60);
if (hours > 0 && minutes > 0) return `resets in ${hours}h ${minutes}m`;
if (hours > 0) return `resets in ${hours}h`;
if (totalHours >= 24) {
const days = Math.floor(totalHours / 24);
const hours = totalHours % 24;
if (hours > 0) return `resets in ${days}d ${hours}h`;
return `resets in ${days}d`;
}
if (totalHours > 0 && minutes > 0) return `resets in ${totalHours}h ${minutes}m`;
if (totalHours > 0) return `resets in ${totalHours}h`;
return `resets in ${minutes}m`;
}
@@ -19,7 +25,11 @@ export function formatResetCountdownISO(isoString: string): string {
}
export function windowLabel(limitWindowSeconds: number): string {
if (limitWindowSeconds <= 3600) return "1h window";
if (limitWindowSeconds <= 86400) return "24h window";
return `${Math.round(limitWindowSeconds / 3600)}h window`;
const hours = limitWindowSeconds / 3600;
if (hours < 24) return `${Math.round(hours)}h`;
const days = hours / 24;
const wholeDays = Math.floor(days);
const remainderHours = Math.round(hours - wholeDays * 24);
if (remainderHours === 0) return `${wholeDays}d`;
return `${wholeDays}d ${remainderHours}h`;
}