diff options
| author | Jon Petersson <jon.petersson@kvadrat.se> | 2024-04-04 13:59:40 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2024-04-08 14:05:16 +0200 |
| commit | 312672b70e36eae8a5046e7ac42c9c457ff41fef (patch) | |
| tree | 3e5cd5b43c9776a1dde461b9db3cf385f45c3434 /ios | |
| parent | 42183bb304e7ef176143647c06f194cd9c9aaba4 (diff) | |
| download | mullvadvpn-312672b70e36eae8a5046e7ac42c9c457ff41fef.tar.xz mullvadvpn-312672b70e36eae8a5046e7ac42c9c457ff41fef.zip | |
Fix location selection bug on iPad
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN/TunnelManager/MapConnectionStatusOperation.swift | 12 | ||||
| -rw-r--r-- | ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift | 7 |
2 files changed, 8 insertions, 11 deletions
diff --git a/ios/MullvadVPN/TunnelManager/MapConnectionStatusOperation.swift b/ios/MullvadVPN/TunnelManager/MapConnectionStatusOperation.swift index 9c13398422..e2a87e882a 100644 --- a/ios/MullvadVPN/TunnelManager/MapConnectionStatusOperation.swift +++ b/ios/MullvadVPN/TunnelManager/MapConnectionStatusOperation.swift @@ -50,27 +50,27 @@ class MapConnectionStatusOperation: AsyncOperation { fetchTunnelStatus(tunnel: tunnel) { observedState in switch observedState { case let .connected(connectionState): - connectionState.isNetworkReachable + return connectionState.isNetworkReachable ? .connected(connectionState.selectedRelay) : .waitingForConnectivity(.noConnection) case let .connecting(connectionState): - connectionState.isNetworkReachable + return connectionState.isNetworkReachable ? .connecting(connectionState.selectedRelay) : .waitingForConnectivity(.noConnection) #if DEBUG case let .negotiatingKey(connectionState): - connectionState.isNetworkReachable + return connectionState.isNetworkReachable ? .negotiatingKey(connectionState.selectedRelay) : .waitingForConnectivity(.noConnection) #endif case let .reconnecting(connectionState): - connectionState.isNetworkReachable + return connectionState.isNetworkReachable ? .reconnecting(connectionState.selectedRelay) : .waitingForConnectivity(.noConnection) case let .error(blockedState): - .error(blockedState.reason) + return .error(blockedState.reason) case .initial, .disconnecting, .disconnected: - .none + return .none } } return diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift index 8340dbf40e..befcaacaf2 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift @@ -241,15 +241,12 @@ extension LocationDataSource: UITableViewDelegate { } func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { - if let item = itemIdentifier(for: indexPath), - item == selectedItem { - cell.setSelected(true, animated: false) + if let item = itemIdentifier(for: indexPath), item == selectedItem { + tableView.selectRow(at: indexPath, animated: false, scrollPosition: .none) } } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - tableView.deselectRow(at: indexPath, animated: false) - guard let item = itemIdentifier(for: indexPath) else { return } var customListSelection: UserSelectedRelays.CustomListSelection? |
