diff --git a/scm-ui/ui-webapp/src/repos/containers/ArchiveRepo.tsx b/scm-ui/ui-webapp/src/repos/containers/ArchiveRepo.tsx index dd29a0b784..65ef0399bc 100644 --- a/scm-ui/ui-webapp/src/repos/containers/ArchiveRepo.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/ArchiveRepo.tsx @@ -62,30 +62,29 @@ const ArchiveRepo: FC = ({ confirmDialog = true, repository, archiveRepo, return null; } - if (showConfirmAlert) { - return ( - archiveRepoCallback(), - }, - { - label: t("archiveRepo.confirmAlert.cancel"), - onClick: () => null, - }, - ]} - close={() => setShowConfirmAlert(false)} - /> - ); - } + const confirmAlert = ( + archiveRepoCallback(), + }, + { + label: t("archiveRepo.confirmAlert.cancel"), + onClick: () => null, + }, + ]} + close={() => setShowConfirmAlert(false)} + /> + ); return ( <> + {showConfirmAlert && confirmAlert} diff --git a/scm-ui/ui-webapp/src/repos/containers/UnarchiveRepo.tsx b/scm-ui/ui-webapp/src/repos/containers/UnarchiveRepo.tsx index e6fdac7edc..c7524b4c7a 100644 --- a/scm-ui/ui-webapp/src/repos/containers/UnarchiveRepo.tsx +++ b/scm-ui/ui-webapp/src/repos/containers/UnarchiveRepo.tsx @@ -62,30 +62,29 @@ const UnarchiveRepo: FC = ({ confirmDialog = true, repository, unarchiveR return null; } - if (showConfirmAlert) { - return ( - unarchiveRepoCallback(), - }, - { - label: t("unarchiveRepo.confirmAlert.cancel"), - onClick: () => null, - }, - ]} - close={() => setShowConfirmAlert(false)} - /> - ); - } + const confirmAlert = ( + unarchiveRepoCallback(), + }, + { + label: t("unarchiveRepo.confirmAlert.cancel"), + onClick: () => null, + }, + ]} + close={() => setShowConfirmAlert(false)} + /> + ); return ( <> + {showConfirmAlert && confirmAlert}