From dea012d4719d547137d4888aba92762b69ae25ae Mon Sep 17 00:00:00 2001 From: Wikid82 Date: Tue, 25 Nov 2025 02:52:35 +0000 Subject: [PATCH] feat: improve sorting logic in CertificateList by adding block scope for case statements --- frontend/src/components/CertificateList.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/CertificateList.tsx b/frontend/src/components/CertificateList.tsx index a3cc2eba..d97fb743 100644 --- a/frontend/src/components/CertificateList.tsx +++ b/frontend/src/components/CertificateList.tsx @@ -31,16 +31,18 @@ export default function CertificateList() { let comparison = 0 switch (sortColumn) { - case 'name': + case 'name': { const aName = (a.name || a.domain || '').toLowerCase() const bName = (b.name || b.domain || '').toLowerCase() comparison = aName.localeCompare(bName) break - case 'expires': + } + case 'expires': { const aDate = new Date(a.expires_at).getTime() const bDate = new Date(b.expires_at).getTime() comparison = aDate - bDate break + } } return sortDirection === 'asc' ? comparison : -comparison