Fixed message request UI still visible after tapping on accept

This commit is contained in:
SessionHero01 2024-10-30 14:43:37 +11:00
parent abd689cfd3
commit 2b0e8a966a
No known key found for this signature in database

View File

@ -1024,13 +1024,13 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
} }
} }
lifecycleScope.launch { lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) { repeatOnLifecycle(Lifecycle.State.STARTED) {
viewModel.uiState viewModel.uiState
.map { it.messageRequestState } .map { it.messageRequestState }
.distinctUntilChanged() .distinctUntilChanged()
.collectLatest { state -> .collectLatest { state ->
binding.messageRequestBar.isVisible = state != MessageRequestUiState.Invisible binding.messageRequestBar.isVisible = state is MessageRequestUiState.Visible
if (state is MessageRequestUiState.Visible) { if (state is MessageRequestUiState.Visible) {
binding.sendAcceptsTextView.setText(state.acceptButtonText) binding.sendAcceptsTextView.setText(state.acceptButtonText)