dont redirect to default branch on changesets view

This commit is contained in:
Eduard Heimbuch
2020-01-15 09:09:54 +01:00
parent 5c654b433b
commit fd23fcee14

View File

@@ -15,14 +15,6 @@ type Props = WithTranslation &
};
class ChangesetsRoot extends React.Component<Props> {
componentDidMount() {
const { branches, baseUrl } = this.props;
if (branches?.length > 0 && this.isSelectedBranchNotABranch()) {
const defaultBranch = branches?.filter(b => b.defaultBranch === true)[0];
this.props.history.replace(`${baseUrl}/branch/${encodeURIComponent(defaultBranch.name)}/changesets/`);
}
}
stripEndingSlash = (url: string) => {
if (url.endsWith("/")) {
return url.substring(0, url.length - 1);