compose: Fix sendAsGroup switch resetting while typing on new conversation (#842)

Fixes #841
This commit is contained in:
Khushal Majoka
2026-07-31 07:25:08 +05:30
committed by GitHub
parent 01474f09cb
commit 7e44142b4e
@@ -621,9 +621,11 @@ class ComposeViewModel @Inject constructor(
// toggle the group sending mode and update the conversation saved value
view.sendAsGroupIntent
.withLatestFrom(state) { _, state -> !state.sendAsGroup }
.doOnNext { newSendAsGroup -> newState { copy(sendAsGroup = newSendAsGroup) } }
.observeOn(Schedulers.io())
.withLatestFrom(conversation, state) { _, conversation, state ->
conversationRepo.updateSendAsGroup(conversation.id, !state.sendAsGroup)
.withLatestFrom(conversation) { newSendAsGroup, conversation ->
conversationRepo.updateSendAsGroup(conversation.id, newSendAsGroup)
}
.autoDisposable(view.scope())
.subscribe()