summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift
diff options
context:
space:
mode:
authorJon Petersson <jon.petersson@kvadrat.se>2024-07-05 15:54:14 +0200
committerEmīls <emils@mullvad.net>2024-07-11 13:03:21 +0200
commit53118705599ba54c3de59546bbdb5c21ee8c598f (patch)
treed8fa545fe9101e881794e0f65c92624261e63a1d /ios/MullvadVPN/View controllers/SelectLocation/LocationDiffableDataSourceProtocol.swift
parentc64351f92895027350c63c3568a92d4128ddec27 (diff)
downloadmullvadvpn-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.swift11
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)
)
)