fix: 修复 iOS 平台 VPN 无法通过导航栏开启的问题

This commit is contained in:
2026-01-17 19:18:23 -08:00
parent 7017c99f4a
commit 620c34401a
+3 -1
View File
@@ -194,7 +194,9 @@ class VPNManager: ObservableObject {
func connect(with config: String, disableMemoryLimit: Bool = false) async throws {
await set(upload: 0, download: 0)
guard state == .disconnected else { return }
// 修复:放宽前置条件,允许在非 connected 状态下连接
// 只要不是已连接状态,都允许尝试连接(包括 invalid、reasserting 等状态)
guard state != .connected else { return }
do {
try await enableVPNManager()
try manager.connection.startVPNTunnel(options: [