Allow group deselection

This commit is contained in:
Ilya Laktyushin 2024-03-01 15:35:25 +04:00
parent 1db0db3929
commit 0f7d073db1

View File

@ -613,15 +613,15 @@ final class ShareWithPeersScreenComponent: Component {
controller.present(alertController, in: .window(.root))
}
if groupTooLarge {
showCountLimitAlert()
return
}
var append = false
if let index = self.selectedGroups.firstIndex(of: peer.id) {
self.selectedGroups.remove(at: index)
} else {
if groupTooLarge {
showCountLimitAlert()
return
}
self.selectedGroups.append(peer.id)
append = true
}