diff --git a/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx b/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx index ba37d6e104..c18be2409a 100644 --- a/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/ChangesetsRoot.tsx @@ -19,7 +19,7 @@ class ChangesetsRoot extends React.Component { const { branches, baseUrl } = this.props; if (branches?.length > 0 && this.isSelectedBranchNotABranch()) { const defaultBranch = branches?.filter(b => b.defaultBranch === true)[0]; - this.props.history.push(`${baseUrl}/branch/${encodeURIComponent(defaultBranch.name)}/changesets/`); + this.props.history.replace(`${baseUrl}/branch/${encodeURIComponent(defaultBranch.name)}/changesets/`); } } diff --git a/scm-ui/ui-webapp/src/repos/sources/containers/Sources.tsx b/scm-ui/ui-webapp/src/repos/sources/containers/Sources.tsx index 790d035ed3..5ce82200f6 100644 --- a/scm-ui/ui-webapp/src/repos/sources/containers/Sources.tsx +++ b/scm-ui/ui-webapp/src/repos/sources/containers/Sources.tsx @@ -34,7 +34,7 @@ class Sources extends React.Component { fetchSources(repository, this.decodeRevision(revision), path); if (branches?.length > 0 && !selectedBranch) { const defaultBranch = branches?.filter(b => b.defaultBranch === true)[0]; - this.props.history.push(`${baseUrl}/sources/${encodeURIComponent(defaultBranch.name)}/`); + this.props.history.replace(`${baseUrl}/sources/${encodeURIComponent(defaultBranch.name)}/`); } } @@ -49,7 +49,7 @@ class Sources extends React.Component { return revision ? decodeURIComponent(revision) : revision; }; - onSelectBranch = (branch?: Branch) => { + onSelectBranch = (branch?: Branch, replaceHistory?: boolean) => { const { baseUrl, history, path } = this.props; let url; if (branch) {