From b4daa7b2e1e0cba19642c6cc900e57788e88ab33 Mon Sep 17 00:00:00 2001 From: Anh Do Date: Mon, 18 Mar 2024 17:16:23 -0400 Subject: [PATCH] Remove duplicated detail --- ...NetworkProtectionDebugViewController.swift | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/DuckDuckGo/NetworkProtectionDebugViewController.swift b/DuckDuckGo/NetworkProtectionDebugViewController.swift index e3ab01c1d1..f6f346b2e2 100644 --- a/DuckDuckGo/NetworkProtectionDebugViewController.swift +++ b/DuckDuckGo/NetworkProtectionDebugViewController.swift @@ -48,7 +48,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { Sections.simulateFailure: "Simulate Failure", Sections.registrationKey: "Registration Key", Sections.networkPath: "Network Path", - Sections.lastDisconnectError: "Last Disconnect Error", Sections.connectionTest: "Connection Test", Sections.vpnConfiguration: "VPN Configuration", Sections.vpnMetadata: "VPN Metadata", @@ -63,7 +62,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { case registrationKey case connectionTest case networkPath - case lastDisconnectError case vpnConfiguration case vpnMetadata } @@ -107,10 +105,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { case networkPath } - enum LastDisconnectErrorRows: Int, CaseIterable { - case lastDisconnectError - } - enum ConnectionTestRows: Int, CaseIterable { case runConnectionTest } @@ -132,7 +126,7 @@ final class NetworkProtectionDebugViewController: UITableViewController { private let pathMonitor = NWPathMonitor() private var currentNetworkPath: String? - private var lastDisconnectError: String? + private var lastError: String? private var baseConfigurationData: String? private var fullProtocolConfigurationData: String? private var vpnMetadata: VPNMetadata? @@ -166,7 +160,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - loadLastDisconnectError() loadConfigurationData() startPathMonitor() @@ -221,9 +214,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { case .networkPath: configure(cell, forNetworkPathRow: indexPath.row) - case .lastDisconnectError: - configure(cell, forLastDisconnectErrorRow: indexPath.row) - case .connectionTest: configure(cell, forConnectionTestRow: indexPath.row) @@ -252,7 +242,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { case .simulateFailure: return SimulateFailureRows.allCases.count case .registrationKey: return RegistrationKeyRows.allCases.count case .networkPath: return NetworkPathRows.allCases.count - case .lastDisconnectError: return LastDisconnectErrorRows.allCases.count case .connectionTest: return ConnectionTestRows.allCases.count + connectionTestResults.count case .vpnConfiguration: return ConfigurationRows.allCases.count case .vpnMetadata: return MetadataRows.allCases.count @@ -281,8 +270,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { didSelectRegistrationKeyAction(at: indexPath) case .networkPath: break - case .lastDisconnectError: - break case .connectionTest: if indexPath.row == connectionTestResults.count { Task { @@ -464,20 +451,6 @@ final class NetworkProtectionDebugViewController: UITableViewController { pathMonitor.start(queue: .main) } - // MARK: Last disconnect error - - private func configure(_ cell: UITableViewCell, forLastDisconnectErrorRow row: Int) { - cell.textLabel?.font = .monospacedSystemFont(ofSize: 13.0, weight: .regular) - cell.textLabel?.text = lastDisconnectError ?? "Loading Last Disconnect Error..." - } - - private func loadLastDisconnectError() { - Task { @MainActor in - lastDisconnectError = await DefaultVPNMetadataCollector().lastDisconnectError() - tableView.reloadData() - } - } - // MARK: Connection Test private func configure(_ cell: UITableViewCell, forConnectionTestRow row: Int) {