diff --git a/scm-ui/src/repos/branches/containers/BranchRoot.js b/scm-ui/src/repos/branches/containers/BranchRoot.js index 2e9fb10f73..7e1fa62c39 100644 --- a/scm-ui/src/repos/branches/containers/BranchRoot.js +++ b/scm-ui/src/repos/branches/containers/BranchRoot.js @@ -13,6 +13,7 @@ import { import { ErrorNotification, Loading } from "@scm-manager/ui-components"; import type { History } from "history"; import { NotFoundError } from "@scm-manager/ui-components"; +import queryString from "query-string"; type Props = { repository: Repository, @@ -49,25 +50,25 @@ class BranchRoot extends React.Component { }; render() { - const { - repository, - branch, - loading, - error, - match, - location - } = this.props; + const { repository, branch, loading, error, match, location } = this.props; const url = this.matchedUrl(); if (error) { - if(error instanceof NotFoundError && location.search.indexOf("?create=true") > -1) { - return ; + if ( + error instanceof NotFoundError && + queryString.parse(location.search).create === "true" + ) { + return ( + + ); } - return ( - - ); + return ; } if (loading || !branch) {