Fix leaving selected group

This commit is contained in:
ganfra 2020-07-06 19:09:08 +02:00
parent 9ebf87df62
commit c1da4aecd7

View File

@ -75,6 +75,11 @@ class GroupListViewModel @AssistedInject constructor(@Assisted initialState: Gro
} }
val optionGroup = Option.just(groupSummary) val optionGroup = Option.just(groupSummary)
selectedGroupStore.post(optionGroup) selectedGroupStore.post(optionGroup)
} else {
// If selected group is null we force to default. It can happens when leaving the selected group.
setState {
copy(selectedGroup = this.asyncGroups()?.find { it.groupId == ALL_COMMUNITIES_GROUP_ID })
}
} }
} }
} }