diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index c82a81b96..57e0bd61b 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -158,6 +158,16 @@ class Detail extends Component{ if((prevState.match.params.projectsId !== this.props.match.params.projectsId)){ this.getDetail(); } + + const { search } = this.props.location; + const search_c = prevState.location && prevState.location.search; + if( search && search!== search_c){ + // console.log("branches",this.props.location); + // console.log("branches_p",prevState.location); + // console.log("111",this.props.dataquerys); + const { projectsId } = this.props.match.params; + this.getBranch(projectsId); + } } diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js index b139b6ae4..b36c3f255 100644 --- a/src/forge/Newfile/UserSubmitComponent.js +++ b/src/forge/Newfile/UserSubmitComponent.js @@ -37,7 +37,8 @@ class UserSubmitComponent extends Component{ message:values.desc }).then((result)=>{ if(result && result.data.name){ - this.props.history.push(`/projects/${projectsId}/coders?branch=${values.branchname}`); + const url = values.branchname ? `/projects/${projectsId}/coders?branch=${values.branchname}` : `/projects/${projectsId}/coders`; + this.props.history.push(url); } }).catch(error=>{ console.log(error);