Skip to content

Commit

Permalink
Remove settings table view cell for UDP port selection menu
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv committed Nov 14, 2024
1 parent 1df371a commit 19c2b8f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,6 @@ final class VPNSettingsCellFactory: CellFactoryProtocol {
cell.disclosureType = .chevron
cell.accessibilityIdentifier = item.accessibilityIdentifier

case .udpOverTcpObfuscationSettings:
guard let cell = cell as? SettingsCell else { return }

cell.titleLabel.text = NSLocalizedString(
"UDP_TCP_OBFUSCATION_CELL_LABEL",
tableName: "VPNSettings",
value: "UDP-over-TCP",
comment: ""
)

cell.disclosureType = .chevron
cell.accessibilityIdentifier = item.accessibilityIdentifier

case let .wireGuardPort(port):
guard let cell = cell as? SelectableSettingsCell else { return }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
case wireGuardCustomPort
case wireGuardObfuscation
case wireGuardObfuscationOption
case udpOverTcpObfuscationSettings
case wireGuardObfuscationPort
case quantumResistance
case multihop
Expand All @@ -41,8 +40,6 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
return SelectableSettingsDetailsCell.self
case .wireGuardObfuscation:
return SelectableSettingsCell.self
case .udpOverTcpObfuscationSettings:
return SettingsCell.self
case .wireGuardObfuscationPort:
return SelectableSettingsCell.self
case .quantumResistance:
Expand All @@ -68,7 +65,6 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
case ipOverrides
case wireGuardPorts
case wireGuardObfuscation
case udpOverTcpObfuscationSettings
case quantumResistance
case privacyAndSecurity
}
Expand All @@ -78,7 +74,6 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
case ipOverrides
case wireGuardPort(_ port: UInt16?)
case wireGuardCustomPort
case udpOverTcpObfuscationSettings
case wireGuardObfuscationAutomatic
case wireGuardObfuscationUdpOverTcp
case wireGuardObfuscationShadowsocks
Expand Down Expand Up @@ -132,8 +127,6 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
return .wireGuardPort
case .wireGuardCustomPort:
return .wireGuardCustomPort
case .udpOverTcpObfuscationSettings:
return .udpOverTcpObfuscationSettings
case .wireGuardObfuscationAutomatic:
return .wireGuardObfuscationAutomatic
case .wireGuardObfuscationUdpOverTcp:
Expand Down Expand Up @@ -165,8 +158,6 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
return .wireGuardPort
case .wireGuardCustomPort:
return .wireGuardCustomPort
case .udpOverTcpObfuscationSettings:
return .udpOverTcpObfuscationSettings
case .wireGuardObfuscationAutomatic, .wireGuardObfuscationOff:
return .wireGuardObfuscation
case .wireGuardObfuscationUdpOverTcp, .wireGuardObfuscationShadowsocks:
Expand Down Expand Up @@ -318,10 +309,6 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
case .wireGuardCustomPort:
getCustomPortCell()?.textField.becomeFirstResponder()

case .udpOverTcpObfuscationSettings:
tableView.deselectRow(at: indexPath, animated: false)
delegate?.showDetails(for: .udpOverTcp)

case .wireGuardObfuscationAutomatic:
selectObfuscationState(.automatic)
delegate?.didUpdateTunnelSettings(TunnelSettingsUpdate.obfuscation(obfuscationSettings))
Expand Down Expand Up @@ -400,7 +387,7 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
let sectionIdentifier = snapshot().sectionIdentifiers[section]

switch sectionIdentifier {
case .dnsSettings, .ipOverrides, .privacyAndSecurity, .udpOverTcpObfuscationSettings:
case .dnsSettings, .ipOverrides, .privacyAndSecurity:
return .leastNonzeroMagnitude
default:
return tableView.estimatedRowHeight
Expand Down Expand Up @@ -458,8 +445,6 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
snapshot.appendSections(Section.allCases)
snapshot.appendItems([.dnsSettings], toSection: .dnsSettings)
snapshot.appendItems([.ipOverrides], toSection: .ipOverrides)
snapshot.appendItems([.udpOverTcpObfuscationSettings], toSection: .udpOverTcpObfuscationSettings)

snapshot.appendItems([.multihopSwitch], toSection: .privacyAndSecurity)

applySnapshot(snapshot, animated: animated, completion: completion)
Expand Down

0 comments on commit 19c2b8f

Please sign in to comment.