Fix preview

This commit is contained in:
世界
2023-09-20 21:17:05 +08:00
parent 9dc7713bd0
commit 390e063f20
13 changed files with 150 additions and 80 deletions
@@ -35,7 +35,7 @@ public struct OverviewView: View {
FormView {
#if os(iOS) || os(tvOS)
StartStopButton()
if profile.status.isConnectedStrict, systemProxyAvailable {
if ApplicationLibrary.inPreview || profile.status.isConnectedStrict, systemProxyAvailable {
Toggle("HTTP Proxy", isOn: $systemProxyEnabled)
.onChangeCompat(of: systemProxyEnabled) { newValue in
Task.detached {
@@ -52,7 +52,7 @@ public struct OverviewView: View {
.pickerStyle(.inline)
}
#elseif os(macOS)
if profile.status.isConnectedStrict, systemProxyAvailable {
if ApplicationLibrary.inPreview || profile.status.isConnectedStrict, systemProxyAvailable {
Toggle("HTTP Proxy", isOn: $systemProxyEnabled)
.onChangeCompat(of: systemProxyEnabled) { newValue in
Task.detached {
@@ -72,7 +72,6 @@ public struct OverviewView: View {
}
}
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
.alertBinding($alert)
.onChangeCompat(of: selectedProfileID) {
reasserting = true