mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-02 00:17:41 +01:00
Fix crash occurring when user rapidly enters and leaves a call.
Co-authored-by: Greyson Parrelli <greyson@signal.org>
This commit is contained in:
committed by
Cody Henthorne
parent
c06944da13
commit
911d7f3be8
@@ -530,6 +530,9 @@ fun <T> 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 <T> 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)
|
||||
|
||||
Reference in New Issue
Block a user