From 4584dafcee5289980e5ac558ab0ce80a8a7a1ecd Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Tue, 9 Jun 2026 09:50:53 +0800 Subject: [PATCH] fix(ui): fix the issue of unable to close CertificateDownloadModal --- .../certificate/CertificateDownloadModal.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/src/components/certificate/CertificateDownloadModal.tsx b/ui/src/components/certificate/CertificateDownloadModal.tsx index 0a6390bf..fc479969 100644 --- a/ui/src/components/certificate/CertificateDownloadModal.tsx +++ b/ui/src/components/certificate/CertificateDownloadModal.tsx @@ -31,8 +31,11 @@ const CertificateDownloadModal = ({ afterClose, data, trigger, ...props }: Certi }); const setOpen = (open: boolean) => { _setOpen(open); - setTableExpandedKeys([]); - formInst.resetFields(); + + if (!open) { + setTableExpandedKeys([]); + formInst.resetFields(); + } }; const triggerEl = useTriggerElement(trigger, { onClick: () => setOpen(true) }); @@ -145,7 +148,9 @@ const CertificateDownloadModal = ({ afterClose, data, trigger, ...props }: Certi ]; const [tableExpandedKeys, setTableExpandedKeys] = useState([]); - const handleCancelClick = () => {}; + const handleCancelClick = () => { + setOpen(false); + }; const handleDownloadClick = async (format: CertificateFormatType) => { await formInst.validateFields();