From 4aa09a5d862eff9281bfd74f34a452aeb6c06b64 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 17 Mar 2023 13:49:52 +0800 Subject: [PATCH] =?UTF-8?q?issue=202616=20issue=E4=BF=9D=E5=AD=98=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E9=99=84=E4=BB=B6id=E4=B8=8D=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Component/Contributors.jsx | 7 ++++++- src/forge/Issues/Component/newPanel.jsx | 14 ++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) 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); } }) }