mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
fix: channel groups are temporarily duplicated after editing
This commit is contained in:
parent
704032dc3d
commit
e92d5b9bc5
@ -72,7 +72,11 @@ class EditChannelGroupSheet : ExpandedBottomSheet() {
|
||||
}
|
||||
|
||||
private fun saveGroup(group: SubscriptionGroup, oldGroupName: String) {
|
||||
channelGroupsModel.groups.value = channelGroupsModel.groups.value?.plus(group)
|
||||
// delete the old instance if the group already existed and add the updated/new one
|
||||
channelGroupsModel.groups.value = channelGroupsModel.groups.value
|
||||
?.filter { it.name != oldGroupName }
|
||||
?.plus(group)
|
||||
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
runCatching {
|
||||
// delete the old one as it might have a different name
|
||||
|
Loading…
Reference in New Issue
Block a user