refactor(ui): remove unnecessary checks (i18n is always defined)

This commit is contained in:
Edouard Vanbelle
2026-04-25 22:55:42 +02:00
parent 156f3bc7ba
commit 4e2029969e
20 changed files with 142 additions and 215 deletions
+2 -1
View File
@@ -209,9 +209,10 @@ function showUserProfileModal() {
const usedBytes = userData.storage_used_bytes || 0;
const quotaBytes = userData.storage_quota_bytes == null ? 10 * 1024 * 1024 * 1024 : userData.storage_quota_bytes;
const percentage = quotaBytes > 0 ? Math.min(Math.round((usedBytes / quotaBytes) * 100), 100) : 0;
// FIXME: use classes
const barColor = percentage > 90 ? '#ef4444' : percentage > 70 ? '#f59e0b' : '#22c55e';
const t = (key, fallback) => (i18n?.t ? i18n.t(key) || fallback : fallback);
const t = (key, fallback) => i18n.t(key) || fallback;
const existing = document.getElementById('profile-modal-overlay');
if (existing) existing.remove();