Fix logic error

This commit is contained in:
Kenta Kubo 2020-12-20 21:15:06 +09:00
parent 993c03a756
commit 34400585ac

View file

@ -40,11 +40,8 @@ struct ContentView {
}
func removeServers(at indexSet: IndexSet) {
if let current = self.selection, indexSet.contains(current) {
self.selection = min(
current,
self.servers.count - 1 - indexSet.count
)
if let current = self.selection, indexSet.contains(where: { $0 <= current }) {
self.selection = nil
}
if indexSet.map({ self.servers[$0].id.uuidString }).contains(self.usedID) {
self.removeSettings()