Issue #6: Always reflect current state of NEDNSSettingsManager.
This commit is contained in:
parent
178a625050
commit
3aee0db9e9
2 changed files with 38 additions and 24 deletions
|
|
@ -3,6 +3,9 @@ import SwiftUI
|
|||
|
||||
struct HomeView: View {
|
||||
|
||||
@Environment(\.scenePhase)
|
||||
private var scenePhase
|
||||
|
||||
@EnvironmentObject
|
||||
private var viewModel: ViewModel
|
||||
|
||||
|
|
@ -204,6 +207,13 @@ struct HomeView: View {
|
|||
}
|
||||
.navigationTitle(ViewModel.title)
|
||||
.animation(.default, value: viewModel.isDnsEnabled)
|
||||
.onChange(of: scenePhase) { _, newPhase in
|
||||
if newPhase == .active {
|
||||
Task {
|
||||
await viewModel.refreshConfig()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue