summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift14
1 files changed, 8 insertions, 6 deletions
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift
index 6d82f5e1b9..a8bd63f1c2 100644
--- a/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift
+++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationViewController.swift
@@ -130,13 +130,10 @@ final class LocationViewController: UIViewController {
// MARK: - Private
private func setUpDataSources() {
- let allLocationDataSource = AllLocationDataSource()
- let customListsDataSource = CustomListsDataSource(repository: customListRepository)
-
dataSource = LocationDataSource(
tableView: tableView,
- allLocations: allLocationDataSource,
- customLists: customListsDataSource
+ allLocations: AllLocationDataSource(),
+ customLists: CustomListsDataSource(repository: customListRepository)
)
dataSource?.didSelectRelayLocations = { [weak self] locations in
@@ -145,7 +142,12 @@ final class LocationViewController: UIViewController {
dataSource?.didTapEditCustomLists = { [weak self] in
guard let self else { return }
- delegate?.didRequestRouteToCustomLists(self, nodes: allLocationDataSource.nodes)
+
+ if let cachedRelays {
+ let allLocationDataSource = AllLocationDataSource()
+ allLocationDataSource.reload(cachedRelays.relays, relays: cachedRelays.relays.wireguard.relays)
+ delegate?.didRequestRouteToCustomLists(self, nodes: allLocationDataSource.nodes)
+ }
}
if let cachedRelays {