mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
Merge pull request #5010 from Bnyro/master
fix: channel groups are temporarily duplicated after editing
This commit is contained in:
commit
e34bb44fa7
@ -72,7 +72,11 @@ class EditChannelGroupSheet : ExpandedBottomSheet() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun saveGroup(group: SubscriptionGroup, oldGroupName: String) {
|
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 {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
runCatching {
|
runCatching {
|
||||||
// delete the old one as it might have a different name
|
// delete the old one as it might have a different name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user