Issue #6: Always reflect current state of NEDNSSettingsManager.

This commit is contained in:
Benjamin Erhart 2026-05-29 16:16:20 +02:00
parent 178a625050
commit 3aee0db9e9
2 changed files with 38 additions and 24 deletions

View file

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