fix branch selector bug

This commit is contained in:
Eduard Heimbuch
2020-01-10 09:31:32 +01:00
parent 184b6e6e98
commit b24af52dfc

View File

@@ -64,15 +64,15 @@ class CodeOverview extends React.Component<Props> {
branchSelected = (branch?: Branch) => {
let splittedUrl = this.props.location.pathname.split("/");
if (
this.props.location.pathname.includes("/code/sources/") ||
this.props.location.pathname.includes("/code/branch/")
this.props.location.pathname.includes("/code/sources") ||
this.props.location.pathname.includes("/code/branch")
) {
if (branch) {
splittedUrl[6] = encodeURIComponent(branch.name);
}
this.props.history.push(splittedUrl.join("/"));
}
if (this.props.location.pathname.includes("/code/changesets/")) {
if (this.props.location.pathname.includes("/code/changesets")) {
this.props.history.push(
`${splittedUrl[0]}/${splittedUrl[1]}/${splittedUrl[2]}/${splittedUrl[3]}/${
splittedUrl[4]