Merge pull request #20 from kkk669/fix-logic-error

Fix logic error
This commit is contained in:
Kenta Kubo 2020-12-20 21:15:56 +09:00 committed by GitHub
commit 43d8e01f67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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()