From 779a91f5cbea8ab4a6d0a6a69019b0e0a53c69d2 Mon Sep 17 00:00:00 2001 From: Avently <7953703+avently@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:00:21 +0700 Subject: [PATCH] removeIf -> removeAll --- .../kotlin/chat/simplex/common/views/helpers/ModalView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ModalView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ModalView.kt index c181f74e99..95dd7116c7 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ModalView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ModalView.kt @@ -105,7 +105,7 @@ class ModalManager(private val placement: ModalPlacement? = null) { // Means, animation is in progress or not started yet. Do not wait until animation finishes, just remove all from screen. // This is useful when invoking close() and ShowCustomModal one after another without delay. Otherwise, screen will hold prev view if (toRemove.isNotEmpty()) { - runAtomically { toRemove.removeIf { elem -> modalViews.removeAt(elem); true } } + runAtomically { toRemove.removeAll { elem -> modalViews.removeAt(elem); true } } } // Make animated appearance only on Android (everytime) and on Desktop (when it's on the start part of the screen or modals > 0) // to prevent unneeded animation on different situations @@ -184,7 +184,7 @@ class ModalManager(private val placement: ModalPlacement? = null) { } // This is needed because if we delete from modalViews immediately on request, animation will be bad if (toRemove.isNotEmpty() && it == modalCount.value && transition.currentState == EnterExitState.Visible && !transition.isRunning) { - runAtomically { toRemove.removeIf { elem -> modalViews.removeAt(elem); true } } + runAtomically { toRemove.removeAll { elem -> modalViews.removeAt(elem); true } } } } }