From b1c6036f295a27791907ff0408f899f25b5102cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Fri, 19 Oct 2018 10:46:51 +0200 Subject: [PATCH] Stay in path on branch change --- scm-ui/src/repos/sources/containers/Sources.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scm-ui/src/repos/sources/containers/Sources.js b/scm-ui/src/repos/sources/containers/Sources.js index 5c3f8b40cc..7859bc73ce 100644 --- a/scm-ui/src/repos/sources/containers/Sources.js +++ b/scm-ui/src/repos/sources/containers/Sources.js @@ -51,13 +51,18 @@ class Sources extends React.Component { } 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 = () => {