diff --git a/scm-ui/ui-webapp/src/repos/branches/containers/DeleteBranch.tsx b/scm-ui/ui-webapp/src/repos/branches/containers/DeleteBranch.tsx index 2319b8cc54..820c09740b 100644 --- a/scm-ui/ui-webapp/src/repos/branches/containers/DeleteBranch.tsx +++ b/scm-ui/ui-webapp/src/repos/branches/containers/DeleteBranch.tsx @@ -49,24 +49,27 @@ const DeleteBranch: FC = ({ repository, branch }: Props) => { return null; } - const confirmAlert = ( - deleteBranch() - }, - { - label: t("branch.delete.confirmAlert.cancel"), - onClick: () => null - } - ]} - close={() => setShowConfirmAlert(false)} - /> - ); + let confirmAlert = null; + if (showConfirmAlert) { + confirmAlert = ( + deleteBranch() + }, + { + label: t("branch.delete.confirmAlert.cancel"), + onClick: () => null + } + ]} + close={() => setShowConfirmAlert(false)} + /> + ); + } return ( <>