Add back include all networks option

This commit is contained in:
世界
2023-09-19 17:48:13 +08:00
parent c73c118926
commit 45d2b9b644
5 changed files with 19 additions and 7 deletions
@@ -20,7 +20,7 @@ public struct ExtensionStatusView: View {
body0
}
}
public var body0: some View {
viewBuilder {
VStack {
@@ -22,6 +22,7 @@ public struct SettingView: View {
@State private var alwaysOn = false
@State private var disableMemoryLimit = false
@State private var includeAllNetworks = false
@State private var version = ""
@State private var dataSize = ""
@State private var taiwanFlagAvailable = false
@@ -80,6 +81,12 @@ public struct SettingView: View {
SharedPreferences.disableMemoryLimit = newValue
}
}
Toggle("Include All Networks", isOn: $includeAllNetworks)
.onChangeCompat(of: includeAllNetworks) { newValue in
Task.detached {
SharedPreferences.includeAllNetworks = newValue
}
}
#if os(macOS)
if Variant.useSystemExtension {
HStack {
@@ -165,6 +172,7 @@ public struct SettingView: View {
#endif
alwaysOn = SharedPreferences.alwaysOn
disableMemoryLimit = SharedPreferences.disableMemoryLimit
includeAllNetworks = SharedPreferences.includeAllNetworks
version = LibboxVersion()
if ApplicationLibrary.inPreview {
dataSize = LibboxFormatBytes(1024 * 1024 * 10)