|
|
@@ -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<string[]>([]); |
|
|
|
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 ( |
|
|
|
<Modal |
|
|
|