Fix flickering confirmation modal (#12211)

Co-authored-by: Adeoluwa Ayangade <adeoluwaayangade@Adeoluwas-MacBook-Pro.local>
This commit is contained in:
Ayangade Adeoluwa 2022-03-25 09:22:23 +01:00 committed by GitHub
parent 9cfb7b38ee
commit 4fb492ee60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,9 +77,13 @@ class RequestConfirmationModal extends React.Component<Props> {
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) => (
<DialogComponent
canEscapeKeyClose
isOpen={modalInfo?.modalOpen}