fix defaultBranch check

This commit is contained in:
Eduard Heimbuch
2019-09-04 15:39:02 +02:00
parent 044c9804c4
commit cdc34be113

View File

@@ -84,11 +84,12 @@ class Sources extends React.Component<Props, State> {
if (this.shouldRedirect()) {
const defaultBranches = branches.filter(b => b.defaultBranch);
if (defaultBranches.length > 0)
if (defaultBranches.length > 0) {
this.setState({ selectedBranch: defaultBranches[0] });
this.props.history.push(
`${baseUrl}/${defaultBranches[0].name.replace("/", "%2F")}/`
);
this.props.history.push(
`${baseUrl}/${defaultBranches[0].name.replace("/", "%2F")}/`
);
}
}
};