diff --git a/src/forge/Component/Contributors.jsx b/src/forge/Component/Contributors.jsx index 04ee3648b..304d8a16e 100644 --- a/src/forge/Component/Contributors.jsx +++ b/src/forge/Component/Contributors.jsx @@ -174,11 +174,16 @@ function Contributors({owner,projectsId,currentLogin}){ { list && list.length>0 && list.map((item,key)=>{ return( + item.id ? - + setVisibleFunc(true,item.login,key)}/> + : + + setVisibleFunc(true,item.login,key)}/> + ) }) } diff --git a/src/forge/Issues/Component/newPanel.jsx b/src/forge/Issues/Component/newPanel.jsx index 0094be5a0..56964aed4 100644 --- a/src/forge/Issues/Component/newPanel.jsx +++ b/src/forge/Issues/Component/newPanel.jsx @@ -1,4 +1,4 @@ -import React , { forwardRef , useState } from 'react'; +import React , { forwardRef , useState , useRef } from 'react'; import { Form , Input , Button } from 'antd'; import MDEditor from "../../../modules/tpm/challengesnew/tpm-md-editor"; import Upload from "../../Upload/Index"; @@ -7,7 +7,6 @@ import UploadImg from '../Img/UploadImg.png'; function NewPanel(props,ref){ const [ description , setDescription ] = useState(""); - const [ fileList , setFileList] = useState(undefined); const [ attachments , setAttachments ] = useState([]); const [ receivers_login , setReceiversLogin ] = useState(undefined); @@ -15,6 +14,8 @@ function NewPanel(props,ref){ const { form: { getFieldDecorator, validateFields , setFieldsValue } } = props; + const fileList = useRef(undefined); + useState(()=>{ title && setTimeout(()=>{ setFieldsValue({subject:title}); @@ -33,16 +34,17 @@ function NewPanel(props,ref){ arr = files.map(i=>{return i.id}); } list = arr && arr.length>0 ? f.concat(arr) : f ; - setFileList(list); + fileList.current = list; }; function deleteLoad(id){ let arr = []; - let list = files + let list = files; if(list && list.length>0 ){ arr = list.filter(i=>i.id !== id); } - setFileList(arr.map(i=>{return i.id})); + let idArr = arr.map(i=>{return i.id}); + fileList.current = idArr; } function changeAtWhoLoginList(loginList){ @@ -54,7 +56,7 @@ function NewPanel(props,ref){ function sureFunc(){ validateFields((error,values)=>{ if (!error) { - createFunc(values,fileList,receivers_login,description); + createFunc(values,fileList.current,receivers_login,description); } }) }