Cleanup
This commit is contained in:
parent
c48a439eea
commit
123ffe9f9c
|
@ -68,14 +68,14 @@ class GroupListViewModel @AssistedInject constructor(@Assisted initialState: Gro
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun observeSelectionState() {
|
private fun observeSelectionState() {
|
||||||
selectSubscribe(GroupListViewState::selectedGroup) {
|
selectSubscribe(GroupListViewState::selectedGroup) { groupSummary ->
|
||||||
if (it != null) {
|
if (groupSummary != null) {
|
||||||
val selectedGroup = _openGroupLiveData.value?.peekContent()
|
val selectedGroup = _openGroupLiveData.value?.peekContent()
|
||||||
// We only wan to open group if the updated selectedGroup is a different one.
|
// We only want to open group if the updated selectedGroup is a different one.
|
||||||
if (selectedGroup?.groupId != it.groupId) {
|
if (selectedGroup?.groupId != groupSummary.groupId) {
|
||||||
_openGroupLiveData.postLiveEvent(it)
|
_openGroupLiveData.postLiveEvent(groupSummary)
|
||||||
}
|
}
|
||||||
val optionGroup = Option.fromNullable(it)
|
val optionGroup = Option.just(groupSummary)
|
||||||
selectedGroupStore.post(optionGroup)
|
selectedGroupStore.post(optionGroup)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue