fix timing error on branchSelector after redirect to defaultBranch on sourcesView

This commit is contained in:
Eduard Heimbuch
2019-09-05 15:12:22 +02:00
parent 19b9350587
commit ac02bf2552

View File

@@ -85,10 +85,10 @@ class Sources extends React.Component<Props, State> {
const defaultBranches = branches.filter(b => b.defaultBranch);
if (defaultBranches.length > 0) {
this.setState({ selectedBranch: defaultBranches[0] });
this.props.history.push(
`${baseUrl}/${encodeURIComponent(defaultBranches[0].name)}/`
);
this.setState({ selectedBranch: defaultBranches[0] });
}
}
};