Skip to content

Commit

Permalink
feat: update AddCustomPortViewController.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajhilje committed Nov 7, 2023
1 parent 5e2a71e commit 2967aae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class AddCustomPortViewController: UITableViewController {
super.viewDidLoad()
updateSelectedPortRange()
typeControl.isEnabled = Application.shared.settings.connectionProtocol.tunnelType() == .openvpn
typeControl.selectedSegmentIndex = UserDefaults.shared.isV2ray && UserDefaults.shared.v2rayProtocol == "tcp" && Application.shared.settings.connectionProtocol.tunnelType() == .wireguard ? 1 : 0
}

// MARK: - Methods -
Expand Down
4 changes: 4 additions & 0 deletions IVPNClient/Scenes/ViewControllers/PortViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class PortViewController: UITableViewController {
continue
}

if !UserDefaults.shared.isV2ray && Application.shared.settings.connectionProtocol.tunnelType() == .wireguard && customPort.type == "tcp" {
continue
}

let string = "\(customPort.vpnProtocol ?? "")-\(customPort.type ?? "")-\(customPort.port)"
ports.append(ConnectionSettings.getFrom(portString: string))
}
Expand Down

0 comments on commit 2967aae

Please sign in to comment.