Stay in path on branch change

This commit is contained in:
René Pfeuffer
2018-10-19 10:46:51 +02:00
parent 80976ec164
commit b1c6036f29

View File

@@ -51,13 +51,18 @@ class Sources extends React.Component<Props> {
}
branchSelected = (branch?: Branch) => {
const { path, baseUrl, history } = this.props;
let url;
if (branch) {
url = `${this.props.baseUrl}/${branch.name}`;
if (path) {
url = `${baseUrl}/${branch.name}/${path}`;
} else {
url = `${baseUrl}/${branch.name}`;
}
} else {
url = `${this.props.baseUrl}/`;
url = `${baseUrl}/`;
}
this.props.history.push(url);
history.push(url);
};
findSelectedBranch = () => {