Fix widget toggle not disabling On Demand before stopping VPN

Store wasOnDemandEnabled flag in providerConfiguration so the widget
can restore On Demand state on next start. Clear the flag when On
Demand is explicitly disabled in settings or when starting from the
main app.
This commit is contained in:
世界
2026-03-09 13:20:53 +08:00
parent c19945f65b
commit efa6088884
3 changed files with 39 additions and 2 deletions
@@ -179,7 +179,7 @@ public class LogViewModel: BaseViewModel {
public init(commandClient: CommandClient, searchText: String = "") {
self.commandClient = commandClient
self.searchText = searchText
self.isSearching = !searchText.isEmpty
isSearching = !searchText.isEmpty
super.init()
dataModel = LogDataModel(commandClient: commandClient, viewModel: self)
}