From 29acb806962a93071df44577149801151d2e72a9 Mon Sep 17 00:00:00 2001 From: zhengzhou Date: Fri, 13 Aug 2021 14:49:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=A1=B9=E7=9B=AE=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=20=E5=A2=9E=E5=8A=A0=E6=89=93=E5=BC=80=E7=AA=97?= =?UTF-8?q?=E4=BD=93=E6=97=B6=E5=88=B7=E6=96=B0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SyncModal/SyncModal.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/SyncModal/SyncModal.tsx b/src/components/SyncModal/SyncModal.tsx index 2348c6f..ede5b2f 100644 --- a/src/components/SyncModal/SyncModal.tsx +++ b/src/components/SyncModal/SyncModal.tsx @@ -53,7 +53,7 @@ export default function SyncModal(props: SyncModalProps) { const [btnLoading, setBtnLoading] = useState(false); const [modalVisible, setModalVisible] = useState(restProps.visible || false); const [selectedKeys, setSelectedKeys] = useState([]); - const { loading, data } = useRequest(async () => { + const { loading, data, refresh } = useRequest(async () => { return await fetchApi('project/queryProjectListByUserId', { userId: currentUser!.id, }); @@ -88,8 +88,9 @@ export default function SyncModal(props: SyncModalProps) { useEffect(() => { if (modalVisible || restProps.visible) { setSelectedKeys([]); + refresh(); } - }, [modalVisible, restProps.visible]); + }, [modalVisible, restProps.visible, refresh]); return (