diff --git a/src/forge/Branch/SelectBranch.js b/src/forge/Branch/SelectBranch.js
index 77edb8254..85ae9040f 100644
--- a/src/forge/Branch/SelectBranch.js
+++ b/src/forge/Branch/SelectBranch.js
@@ -1,5 +1,5 @@
import React , { Component } from 'react';
-import { Dropdown , Icon , Menu } from 'antd';
+import { Dropdown , Icon , Input } from 'antd';
import "./branch.css"
@@ -59,16 +59,15 @@ class SelectBranch extends Component{
const { branchs , branch } = this.props;
let branchsFilter = value ? (branchs && branchs.length>0 && branchs.filter(item=>item.name.indexOf(value)>-1)):branchs;
-
+ console.log("value",value);
const menu = (
-
+
changeBranch(value)}>{item.name}
)
})
}
diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js
index 207f3d324..ef2d52e9c 100644
--- a/src/forge/Main/CoderRootDirectory.js
+++ b/src/forge/Main/CoderRootDirectory.js
@@ -256,24 +256,23 @@ class CoderRootDirectory extends Component{
const { branchList } = this.props;
let branchLastCommit = branchList && branchList.length >0 && branchList.filter(item=>item.name === value)[0];
- this.setState({
- branch:branchLastCommit && branchLastCommit.name,
- branchLastCommit,
- http_url:branchLastCommit && branchLastCommit.http_url,
- isSpin: true
- })
if(branchLastCommit){
- const { pathname } = this.props.location;
- if(pathname && pathname.indexOf("?url=")>-1){
- let url =pathname.split("?url=")[1];
+ this.setState({
+ branch:value,
+ branchLastCommit,
+ http_url:branchLastCommit && branchLastCommit.http_url,
+ isSpin: true
+ })
+ let { search } = this.props.history.location;
+ if(search && search.indexOf("?url=")>-1){
+ let url =search.split("?url=")[1];
this.setState({
filePath:url
})
- this.getFileDetail(url, branchLastCommit.name);
+ this.getFileDetail(url, value);
}else{
- this.getProjectRoot( branchLastCommit.name );
+ this.getProjectRoot( value );
}
- // this.props.history.location.search.replace( branchLastCommit.name );
}
}
render(){