diff options
| author | Jon Petersson <jon.petersson@kvadrat.se> | 2024-07-05 15:54:14 +0200 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2024-07-11 13:03:21 +0200 |
| commit | 53118705599ba54c3de59546bbdb5c21ee8c598f (patch) | |
| tree | d8fa545fe9101e881794e0f65c92624261e63a1d /ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift | |
| parent | c64351f92895027350c63c3568a92d4128ddec27 (diff) | |
| download | mullvadvpn-53118705599ba54c3de59546bbdb5c21ee8c598f.tar.xz mullvadvpn-53118705599ba54c3de59546bbdb5c21ee8c598f.zip | |
Prevent user from selecting same entry and exit relay for multihop
Diffstat (limited to 'ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift')
| -rw-r--r-- | ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift index 59f7e12d21..0450be0a81 100644 --- a/ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift +++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift @@ -14,7 +14,6 @@ protocol LocationDiffableDataSourceProtocol: UITableViewDiffableDataSource<Locat var sections: [LocationSection] { get } func nodeShowsChildren(_ node: LocationNode) -> Bool func nodeShouldBeSelected(_ node: LocationNode) -> Bool - func excludedRelayTitle(_ node: LocationNode) -> String? } extension LocationDiffableDataSourceProtocol { @@ -40,10 +39,7 @@ extension LocationDiffableDataSourceProtocol { } } - func toggledItems( - for cell: LocationCell, - excludedRelayTitleCallback: ((LocationNode) -> String?)? = nil - ) -> [[LocationCellViewModel]] { + func toggledItems(for cell: LocationCell) -> [[LocationCellViewModel]] { guard let indexPath = tableView.indexPath(for: cell), let item = itemIdentifier(for: indexPath) else { return [[]] } @@ -54,7 +50,7 @@ extension LocationDiffableDataSourceProtocol { item.node.showsChildren = !isExpanded if !isExpanded { - locationList.addSubNodes(from: item, at: indexPath, excludedRelayTitleCallback: excludedRelayTitleCallback) + locationList.addSubNodes(from: item, at: indexPath) } else { locationList.removeSubNodes(from: item.node) } @@ -103,8 +99,7 @@ extension LocationDiffableDataSourceProtocol { section: section, node: childNode, indentationLevel: indentationLevel, - isSelected: nodeShouldBeSelected(childNode), - excludedRelayTitle: excludedRelayTitle(childNode) + isSelected: nodeShouldBeSelected(childNode) ) ) |
