forked from upstream-mirrors/quik
compose: Fix sendAsGroup switch resetting while typing on new conversation (#842)
Fixes #841
This commit is contained in:
@@ -621,9 +621,11 @@ class ComposeViewModel @Inject constructor(
|
|||||||
|
|
||||||
// toggle the group sending mode and update the conversation saved value
|
// toggle the group sending mode and update the conversation saved value
|
||||||
view.sendAsGroupIntent
|
view.sendAsGroupIntent
|
||||||
|
.withLatestFrom(state) { _, state -> !state.sendAsGroup }
|
||||||
|
.doOnNext { newSendAsGroup -> newState { copy(sendAsGroup = newSendAsGroup) } }
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.withLatestFrom(conversation, state) { _, conversation, state ->
|
.withLatestFrom(conversation) { newSendAsGroup, conversation ->
|
||||||
conversationRepo.updateSendAsGroup(conversation.id, !state.sendAsGroup)
|
conversationRepo.updateSendAsGroup(conversation.id, newSendAsGroup)
|
||||||
}
|
}
|
||||||
.autoDisposable(view.scope())
|
.autoDisposable(view.scope())
|
||||||
.subscribe()
|
.subscribe()
|
||||||
|
|||||||
Reference in New Issue
Block a user