diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/v2/CallGrid.kt b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/v2/CallGrid.kt index ec318545eb..7dd32e33aa 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/v2/CallGrid.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/webrtc/v2/CallGrid.kt @@ -530,6 +530,9 @@ fun CallGrid( val hasExistingItems = knownKeys.isNotEmpty() newKeys.forEach { key -> + if (exitingItems.any { it.key == key }) { + exitingItems = exitingItems.filterNot { it.key == key } + } if (hasExistingItems) { alphaAnimatables[key] = Animatable(0f) scaleAnimatables[key] = Animatable(CallGridDefaults.ENTER_SCALE_START) @@ -569,7 +572,9 @@ fun CallGrid( launch { scaleAnimatables[key]?.animateTo(CallGridDefaults.EXIT_SCALE_END, CallGridDefaults.scaleAnimationSpec) } } exitingItems = exitingItems.filterNot { it.key == key } - removeAnimationState(key) + if (key !in knownKeys) { + removeAnimationState(key) + } } } else { removeAnimationState(key)