From 92232c0b4c72d561f2b02c0a509bafd3c62d3c81 Mon Sep 17 00:00:00 2001 From: Eduard Heimbuch Date: Wed, 16 Dec 2020 11:52:24 +0100 Subject: [PATCH] fix jumping ui in repository settings actions --- .../src/repos/containers/ArchiveRepo.tsx | 39 +++++++++---------- .../src/repos/containers/UnarchiveRepo.tsx | 39 +++++++++---------- 2 files changed, 38 insertions(+), 40 deletions(-) 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}