Fix #4991: lifecycle should be at least started

This commit is contained in:
Tiago Loureiro 2022-01-19 11:56:14 -03:00
parent e73992f5df
commit 4dea7131b1

View file

@ -675,7 +675,7 @@ class RoomDetailFragment @Inject constructor(
*/
private fun EmojiPopup.Builder.setOnEmojiPopupDismissListenerLifecycleAware(action: () -> Unit): EmojiPopup.Builder {
return setOnEmojiPopupDismissListener {
if (lifecycle.currentState == Lifecycle.State.STARTED) {
if (lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) {
action()
}
}