Skip to content

Commit

Permalink
fix: showFileBlackListModal
Browse files Browse the repository at this point in the history
  • Loading branch information
lulu-tro committed Dec 19, 2024
1 parent 2e519bd commit 8ed9bbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/components/Modals/FileBlackListModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -32,6 +32,7 @@ export default function EncryptFileModal({ color, closeModal, showModal = false
setValidateMsg('');
getFileBlackListData();
}
setIsEdit(false);
// Emitter.on('openDecryptFileModal', set);
return () => {
// Emitter.removeListener('openDecryptFileModal');
Expand All @@ -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) {
Expand Down
8 changes: 6 additions & 2 deletions src/components/Tables/LocalFilesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,13 @@ export default function LocalFilesTable({ color }) {
setActiveKey(activeKey);
};

const showFileBlackListModalFn= ()=>{
setShowFileBlackListModal(true)
}

const operations = () => {
// if (activeKey === '2') {
return <button className="common-btn theme-white-btn" onClick={()=> setShowFileBlackListModal(true)} >{t('file_black_list')}</button>;
return <button className="common-btn theme-white-btn" onClick={showFileBlackListModalFn} >{t('file_black_list')}</button>;
// }
// return null
};
Expand Down Expand Up @@ -478,9 +482,9 @@ export default function LocalFilesTable({ color }) {
data={batch}
/>
</div>
<FileBlackListModal color={color} showModal={showFileBlackListModal} closeModal={()=> setShowFileBlackListModal(false)} />
</Tabs.TabPane>
</Tabs>
<FileBlackListModal color={color} showModal={showFileBlackListModal} closeModal={()=> setShowFileBlackListModal(false)} />
</>
);
}
Expand Down

0 comments on commit 8ed9bbd

Please sign in to comment.