From 0a9fdfc3dfb04d0011bf71bd55c8c995c4f0a3f1 Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Fri, 2 Dec 2022 08:54:37 +0100 Subject: [PATCH] fix flickering toggle (#2584) --- frontend/src/component/common/Loader/Loader.styles.ts | 2 +- .../ChangeRequestConfiguration.tsx | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/frontend/src/component/common/Loader/Loader.styles.ts b/frontend/src/component/common/Loader/Loader.styles.ts index 7284ea586f..2291beb722 100644 --- a/frontend/src/component/common/Loader/Loader.styles.ts +++ b/frontend/src/component/common/Loader/Loader.styles.ts @@ -5,7 +5,7 @@ export const useStyles = makeStyles()(theme => ({ display: 'flex', justifyContent: 'center', alignItems: 'center', - height: '100%', + minHeight: '100vh', backgroundColor: theme.palette.background.paper, }, img: { diff --git a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx index 89116d84c1..1c457771f7 100644 --- a/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx +++ b/frontend/src/component/project/Project/ProjectSettings/ChangeRequestConfiguration/ChangeRequestConfiguration.tsx @@ -53,6 +53,7 @@ export const ChangeRequestConfiguration: VFC = () => { isEnabled: false, requiredApprovals: 1, }); + const theme = useTheme(); const projectId = useRequiredPathParam('projectId'); const { data, loading, refetchChangeRequestConfig } = @@ -79,12 +80,7 @@ export const ChangeRequestConfiguration: VFC = () => { if (dialogState.enableEnvironment) { await updateConfiguration(); } - setDialogState({ - isOpen: false, - enableEnvironment: '', - isEnabled: false, - requiredApprovals: 1, - }); + setDialogState(state => ({ ...state, isOpen: false })); }; async function updateConfiguration(config?: IChangeRequestConfig) {