From 8ed9bbd1d36236784130a0ca099608bdf66875e3 Mon Sep 17 00:00:00 2001 From: lulu Date: Thu, 19 Dec 2024 15:45:10 +0800 Subject: [PATCH] fix: showFileBlackListModal --- src/components/Modals/FileBlackListModal.js | 7 ++----- src/components/Tables/LocalFilesTable.js | 8 ++++++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Modals/FileBlackListModal.js b/src/components/Modals/FileBlackListModal.js index f764468..c127841 100644 --- a/src/components/Modals/FileBlackListModal.js +++ b/src/components/Modals/FileBlackListModal.js @@ -10,7 +10,7 @@ import isIPFS from 'is-ipfs'; const { TextArea } = Input; -export default function EncryptFileModal({ color, closeModal, showModal = false }) { +export default function FileBlackListModal({ color, closeModal, showModal }) { const intl = useIntl(); const [loading, setLoading] = useState(false); const [isEdit, setIsEdit] = useState(false); @@ -32,6 +32,7 @@ export default function EncryptFileModal({ color, closeModal, showModal = false setValidateMsg(''); getFileBlackListData(); } + setIsEdit(false); // Emitter.on('openDecryptFileModal', set); return () => { // Emitter.removeListener('openDecryptFileModal'); @@ -40,10 +41,6 @@ export default function EncryptFileModal({ color, closeModal, showModal = false // eslint-disable-next-line react-hooks/exhaustive-deps }, [showModal]); - useEffect(() => { - setIsEdit(false); - }, [showModal]); - const validateCid = val => { let res = isIPFS.cid(val); if (res) { diff --git a/src/components/Tables/LocalFilesTable.js b/src/components/Tables/LocalFilesTable.js index 65f9e26..690d807 100644 --- a/src/components/Tables/LocalFilesTable.js +++ b/src/components/Tables/LocalFilesTable.js @@ -211,9 +211,13 @@ export default function LocalFilesTable({ color }) { setActiveKey(activeKey); }; + const showFileBlackListModalFn= ()=>{ + setShowFileBlackListModal(true) + } + const operations = () => { // if (activeKey === '2') { - return ; + return ; // } // return null }; @@ -478,9 +482,9 @@ export default function LocalFilesTable({ color }) { data={batch} /> - setShowFileBlackListModal(false)} /> + setShowFileBlackListModal(false)} /> ); }