From a22653d7da63b3af3dd60a9d5647a77bb4063203 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 30 Jan 2024 10:19:53 +0100 Subject: [PATCH] Fix: ensure the effect is restarted on each sync update. --- .../android/features/messages/impl/MessagesPresenter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt index 6ae5be0621..d378014e2f 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesPresenter.kt @@ -155,7 +155,7 @@ class MessagesPresenter @AssistedInject constructor( mutableStateOf(false) } - LaunchedEffect(syncUpdateFlow) { + LaunchedEffect(syncUpdateFlow.value) { withContext(dispatchers.io) { canJoinCall = room.canUserJoinCall(room.sessionId).getOrDefault(false) } @@ -163,7 +163,7 @@ class MessagesPresenter @AssistedInject constructor( val inviteProgress = remember { mutableStateOf>(AsyncData.Uninitialized) } var showReinvitePrompt by remember { mutableStateOf(false) } - LaunchedEffect(hasDismissedInviteDialog, composerState.hasFocus, syncUpdateFlow) { + LaunchedEffect(hasDismissedInviteDialog, composerState.hasFocus, syncUpdateFlow.value) { withContext(dispatchers.io) { showReinvitePrompt = !hasDismissedInviteDialog && composerState.hasFocus && room.isDirect && room.activeMemberCount == 1L }