mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
only instantiate confirmAlert if needed
This commit is contained in:
@@ -49,7 +49,9 @@ const DeleteBranch: FC<Props> = ({ repository, branch }: Props) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
const confirmAlert = (
|
||||
let confirmAlert = null;
|
||||
if (showConfirmAlert) {
|
||||
confirmAlert = (
|
||||
<ConfirmAlert
|
||||
title={t("branch.delete.confirmAlert.title")}
|
||||
message={t("branch.delete.confirmAlert.message", { branch: branch.name })}
|
||||
@@ -67,6 +69,7 @@ const DeleteBranch: FC<Props> = ({ repository, branch }: Props) => {
|
||||
close={() => setShowConfirmAlert(false)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user