Messages: remove some blocking code from main thread

This commit is contained in:
ganfra 2023-07-28 17:55:43 +02:00
parent a2c59d4469
commit 42f0474dd2

View file

@ -122,17 +122,12 @@ class MessagesPresenter @AssistedInject constructor(
} }
val inviteProgress = remember { mutableStateOf<Async<Unit>>(Async.Uninitialized) } val inviteProgress = remember { mutableStateOf<Async<Unit>>(Async.Uninitialized) }
var showReinvitePrompt by remember { mutableStateOf(false) }
val showReinvitePrompt by remember( LaunchedEffect(hasDismissedInviteDialog, composerState.hasFocus, syncUpdateFlow) {
hasDismissedInviteDialog, withContext(dispatchers.io) {
composerState.hasFocus, showReinvitePrompt = !hasDismissedInviteDialog && composerState.hasFocus && room.isDirect && room.activeMemberCount == 1L
syncUpdateFlow,
) {
derivedStateOf {
!hasDismissedInviteDialog && composerState.hasFocus && room.isDirect && room.activeMemberCount == 1L
} }
} }
val networkConnectionStatus by networkMonitor.connectivity.collectAsState() val networkConnectionStatus by networkMonitor.connectivity.collectAsState()
val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState() val snackbarMessage by snackbarDispatcher.collectSnackbarMessageAsState()