mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
added specific check for errortype for create newbranch redirect
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
} from "../modules/branches";
|
||||
import { ErrorPage, Loading } from "@scm-manager/ui-components";
|
||||
import type { History } from "history";
|
||||
import { NotFoundError } from "./errors";
|
||||
|
||||
type Props = {
|
||||
repository: Repository,
|
||||
@@ -63,7 +64,7 @@ class BranchRoot extends React.Component<Props> {
|
||||
const url = this.matchedUrl();
|
||||
|
||||
if (error) {
|
||||
if(location.search.indexOf("?create=true") > -1) {
|
||||
if(error instanceof NotFoundError && location.search.indexOf("?create=true") > -1) {
|
||||
return <Redirect to={`/repo/${repository.namespace}/${repository.name}/branches/create?name=${match.params.branch}`} />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user