From 692f7f3cdee9e5c9a9b887bc1697079e6e0a6d5e Mon Sep 17 00:00:00 2001 From: moxi Date: Sun, 4 Jan 2026 18:48:27 +0800 Subject: [PATCH] fix(quota): allow refresh without creds --- src/components/quota/QuotaSection.tsx | 3 ++- src/pages/QuotaPage.module.scss | 4 ++-- src/styles/themes.scss | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/quota/QuotaSection.tsx b/src/components/quota/QuotaSection.tsx index ab7fcf9..377285c 100644 --- a/src/components/quota/QuotaSection.tsx +++ b/src/components/quota/QuotaSection.tsx @@ -179,6 +179,7 @@ export function QuotaSection({ pendingQuotaRefreshRef.current = false; const scope = effectiveViewMode === 'all' ? 'all' : 'page'; const targets = effectiveViewMode === 'all' ? filteredFiles : pageItems; + if (targets.length === 0) return; loadQuota(targets, scope, setLoading); }, [loading, effectiveViewMode, filteredFiles, pageItems, loadQuota, setLoading]); @@ -244,7 +245,7 @@ export function QuotaSection({ variant="secondary" size="sm" onClick={handleRefresh} - disabled={disabled || isRefreshing || filteredFiles.length === 0} + disabled={disabled || isRefreshing} loading={isRefreshing} title={t('quota_management.refresh_files_and_quota')} aria-label={t('quota_management.refresh_files_and_quota')} diff --git a/src/pages/QuotaPage.module.scss b/src/pages/QuotaPage.module.scss index a515471..5d52e9a 100644 --- a/src/pages/QuotaPage.module.scss +++ b/src/pages/QuotaPage.module.scss @@ -57,8 +57,8 @@ border-radius: 999px; font-size: 13px; font-weight: 600; - color: #0284c7; // sky-600 - background-color: #e0f2fe; // sky-100 + color: var(--count-badge-text); + background-color: var(--count-badge-bg); box-sizing: border-box; } diff --git a/src/styles/themes.scss b/src/styles/themes.scss index 65dde1f..1892763 100644 --- a/src/styles/themes.scss +++ b/src/styles/themes.scss @@ -32,6 +32,9 @@ --failure-badge-text: #991b1b; --failure-badge-border: #fca5a5; + --count-badge-bg: rgba(59, 130, 246, 0.14); + --count-badge-text: var(--primary-active); + --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1); } @@ -66,6 +69,9 @@ --failure-badge-text: #fca5a5; --failure-badge-border: #dc2626; + --count-badge-bg: rgba(59, 130, 246, 0.25); + --count-badge-text: var(--primary-active); + --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3); }