From 4fb492ee60ea463853f23d6a8a3f073932a20ae3 Mon Sep 17 00:00:00 2001 From: Ayangade Adeoluwa <37867493+Irongade@users.noreply.github.com> Date: Fri, 25 Mar 2022 09:22:23 +0100 Subject: [PATCH] Fix flickering confirmation modal (#12211) Co-authored-by: Adeoluwa Ayangade --- app/client/src/pages/Editor/RequestConfirmationModal.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/client/src/pages/Editor/RequestConfirmationModal.tsx b/app/client/src/pages/Editor/RequestConfirmationModal.tsx index 7126aaaa1b..19728cd156 100644 --- a/app/client/src/pages/Editor/RequestConfirmationModal.tsx +++ b/app/client/src/pages/Editor/RequestConfirmationModal.tsx @@ -77,9 +77,13 @@ class RequestConfirmationModal extends React.Component { render() { const { dispatch, modals } = this.props; + // making sure that only modals that are set to be open are eventually opened. + // basically filters out modals that have already been opened and prevents it from flashing after other modals have been confirmed. + const modalsToBeOpened = modals.filter((modal) => modal.modalOpen === true); + return ( <> - {modals.map((modalInfo: ModalInfo, index: number) => ( + {modalsToBeOpened.map((modalInfo: ModalInfo, index: number) => (