Fix the issue that settings aren't saved until the toggle status is changed

This commit is contained in:
Kenta Kubo 2020-10-16 01:18:02 +09:00
parent aae4848ed6
commit 2a6b4dd5dd

View file

@ -46,6 +46,7 @@ struct ContentView {
)
}
self.servers.remove(atOffsets: indexSet)
self.syncSettings()
}
func moveServers(from src: IndexSet, to dst: Int) {
@ -121,7 +122,10 @@ extension ContentView: View {
destination: DetailView(
server: .init(
get: { server },
set: { self.servers[i] = $0 }
set: {
self.servers[i] = $0
self.syncSettings()
}
),
isOn: .init(
get: {