Addon-Kauf im Event admin korrigiert.

This commit is contained in:
Codex Agent
2025-12-29 19:31:26 +01:00
parent aaf418a917
commit 902e78cae9
8 changed files with 295 additions and 29 deletions

View File

@@ -104,12 +104,21 @@ export function buildLimitWarnings(limits: EventLimitSummary, t: TranslateFn): L
} else if (limits.gallery.state === 'warning') {
const days = limits.gallery.days_remaining ?? 0;
const safeDays = Math.max(0, days);
const key = safeDays === 1 ? 'galleryWarningDay' : 'galleryWarningDays';
const useHours = safeDays > 0 && safeDays < 2;
const roundedDays = Math.max(1, Math.ceil(safeDays));
const roundedHours = Math.max(1, Math.ceil(safeDays * 24));
const key = useHours
? roundedHours === 1
? 'galleryWarningHour'
: 'galleryWarningHours'
: roundedDays === 1
? 'galleryWarningDay'
: 'galleryWarningDays';
warnings.push({
id: 'gallery-warning',
scope: 'gallery',
tone: 'warning',
message: t(key, { days: safeDays }),
message: t(key, useHours ? { hours: roundedHours } : { days: roundedDays }),
});
}
}