Fix leaving selected group

This commit is contained in:
ganfra 2020-07-06 19:09:08 +02:00
parent 9ebf87df62
commit c1da4aecd7
1 changed files with 5 additions and 0 deletions

View File

@ -75,6 +75,11 @@ class GroupListViewModel @AssistedInject constructor(@Assisted initialState: Gro
}
val optionGroup = Option.just(groupSummary)
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 })
}
}
}
}