mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
fix defaultBranch check
This commit is contained in:
@@ -84,11 +84,12 @@ class Sources extends React.Component<Props, State> {
|
|||||||
if (this.shouldRedirect()) {
|
if (this.shouldRedirect()) {
|
||||||
const defaultBranches = branches.filter(b => b.defaultBranch);
|
const defaultBranches = branches.filter(b => b.defaultBranch);
|
||||||
|
|
||||||
if (defaultBranches.length > 0)
|
if (defaultBranches.length > 0) {
|
||||||
this.setState({ selectedBranch: defaultBranches[0] });
|
this.setState({ selectedBranch: defaultBranches[0] });
|
||||||
this.props.history.push(
|
this.props.history.push(
|
||||||
`${baseUrl}/${defaultBranches[0].name.replace("/", "%2F")}/`
|
`${baseUrl}/${defaultBranches[0].name.replace("/", "%2F")}/`
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user