mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
replace current history entry on redirect to default branch instead of pushing a new history entry
This commit is contained in:
@@ -34,7 +34,7 @@ class Sources extends React.Component<Props> {
|
||||
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<Props> {
|
||||
return revision ? decodeURIComponent(revision) : revision;
|
||||
};
|
||||
|
||||
onSelectBranch = (branch?: Branch) => {
|
||||
onSelectBranch = (branch?: Branch, replaceHistory?: boolean) => {
|
||||
const { baseUrl, history, path } = this.props;
|
||||
let url;
|
||||
if (branch) {
|
||||
|
||||
Reference in New Issue
Block a user