Extract common function 'matchedUrl'

This commit is contained in:
René Pfeuffer
2020-09-18 17:38:10 +02:00
parent 4523e22feb
commit bbfe2b08bc
11 changed files with 43 additions and 79 deletions

View File

@@ -55,14 +55,10 @@ class BranchRoot extends React.Component<Props> {
fetchBranch(repository, branchName);
}
matchedUrl = () => {
return urls.stripEndingSlash(this.props.match.url);
};
render() {
const { repository, branch, loading, error, match, location } = this.props;
const url = this.matchedUrl();
const url = urls.matchedUrl(this.props);
if (error) {
if (error instanceof NotFoundError && queryString.parse(location.search).create === "true") {