summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ios/MullvadVPN.xcodeproj/project.pbxproj4
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/InMemoryCustomListRepository.swift55
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift5
-rw-r--r--ios/MullvadVPN/View controllers/SelectLocation/LocationSection.swift8
4 files changed, 1 insertions, 71 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj
index 270ecdabc9..fcd39ee55e 100644
--- a/ios/MullvadVPN.xcodeproj/project.pbxproj
+++ b/ios/MullvadVPN.xcodeproj/project.pbxproj
@@ -868,7 +868,6 @@
F09D04BD2AEBB7C5003D4F89 /* OutgoingConnectionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09D04BC2AEBB7C5003D4F89 /* OutgoingConnectionService.swift */; };
F09D04C02AF39D63003D4F89 /* OutgoingConnectionServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09D04BF2AF39D63003D4F89 /* OutgoingConnectionServiceTests.swift */; };
F09D04C12AF39EA2003D4F89 /* OutgoingConnectionService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F09D04BC2AEBB7C5003D4F89 /* OutgoingConnectionService.swift */; };
- F0A92B3C2B8E44F900DC7B37 /* InMemoryCustomListRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A92B3B2B8E44F900DC7B37 /* InMemoryCustomListRepository.swift */; };
F0B0E6972AFE6E7E001DC66B /* XCTest+Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0B0E6962AFE6E7E001DC66B /* XCTest+Async.swift */; };
F0BE65372B9F136A005CC385 /* LocationSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0BE65362B9F136A005CC385 /* LocationSectionHeaderView.swift */; };
F0C2AEFD2A0BB5CC00986207 /* NotificationProviderIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0C2AEFC2A0BB5CC00986207 /* NotificationProviderIdentifier.swift */; };
@@ -2020,7 +2019,6 @@
F09D04BA2AE95396003D4F89 /* URLSessionStub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionStub.swift; sourceTree = "<group>"; };
F09D04BC2AEBB7C5003D4F89 /* OutgoingConnectionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutgoingConnectionService.swift; sourceTree = "<group>"; };
F09D04BF2AF39D63003D4F89 /* OutgoingConnectionServiceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutgoingConnectionServiceTests.swift; sourceTree = "<group>"; };
- F0A92B3B2B8E44F900DC7B37 /* InMemoryCustomListRepository.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InMemoryCustomListRepository.swift; sourceTree = "<group>"; };
F0B0E6962AFE6E7E001DC66B /* XCTest+Async.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCTest+Async.swift"; sourceTree = "<group>"; };
F0BE65362B9F136A005CC385 /* LocationSectionHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationSectionHeaderView.swift; sourceTree = "<group>"; };
F0C2AEFC2A0BB5CC00986207 /* NotificationProviderIdentifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationProviderIdentifier.swift; sourceTree = "<group>"; };
@@ -2445,7 +2443,6 @@
F050AE5F2B73A41E003F4EDB /* AllLocationDataSource.swift */,
F04413602BA45CD70018A6EE /* CustomListLocationNodeBuilder.swift */,
F050AE612B74DBAC003F4EDB /* CustomListsDataSource.swift */,
- F0A92B3B2B8E44F900DC7B37 /* InMemoryCustomListRepository.swift */,
5888AD82227B11080051EB06 /* LocationCell.swift */,
F050AE4D2B70D7F8003F4EDB /* LocationCellViewModel.swift */,
583DA21325FA4B5C00318683 /* LocationDataSource.swift */,
@@ -5198,7 +5195,6 @@
58C774BE29A7A249003A1A56 /* CustomNavigationController.swift in Sources */,
E1FD0DF528AA7CE400299DB4 /* StatusActivityView.swift in Sources */,
F0BE65372B9F136A005CC385 /* LocationSectionHeaderView.swift in Sources */,
- F0A92B3C2B8E44F900DC7B37 /* InMemoryCustomListRepository.swift in Sources */,
7A2960FD2A964BB700389B82 /* AlertPresentation.swift in Sources */,
0697D6E728F01513007A9E99 /* TransportMonitor.swift in Sources */,
58968FAE28743E2000B799DC /* TunnelInteractor.swift in Sources */,
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/InMemoryCustomListRepository.swift b/ios/MullvadVPN/View controllers/SelectLocation/InMemoryCustomListRepository.swift
deleted file mode 100644
index 4a72fa61e1..0000000000
--- a/ios/MullvadVPN/View controllers/SelectLocation/InMemoryCustomListRepository.swift
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// InMemoryCustomListRepository.swift
-// MullvadVPN
-//
-// Created by Mojgan on 2024-01-31.
-// Copyright © 2024 Mullvad VPN AB. All rights reserved.
-//
-
-import Combine
-import Foundation
-import MullvadSettings
-import MullvadTypes
-
-class InMemoryCustomListRepository: CustomListRepositoryProtocol {
- private var customRelayLists: [CustomList] = [
- CustomList(
- id: UUID(uuidString: "F17948CB-18E2-4F84-82CD-5780F94216DB")!,
- name: "Netflix",
- locations: [.hostname("al", "tia", "al-tia-wg-001")]
- ),
- CustomList(
- id: UUID(uuidString: "4104C603-B35D-4A64-8865-96C0BF33D57F")!,
- name: "Streaming",
- locations: [
- .city("us", "dal"),
- .country("se"),
- .city("de", "ber"),
- ]
- ),
- ]
-
- func save(list: CustomList) throws {
- if let index = customRelayLists.firstIndex(where: { $0.id == list.id }) {
- customRelayLists[index] = list
- } else if customRelayLists.contains(where: { $0.name == list.name }) {
- throw CustomRelayListError.duplicateName
- } else {
- customRelayLists.append(list)
- }
- }
-
- func delete(id: UUID) {
- if let index = customRelayLists.firstIndex(where: { $0.id == id }) {
- customRelayLists.remove(at: index)
- }
- }
-
- func fetch(by id: UUID) -> CustomList? {
- return customRelayLists.first(where: { $0.id == id })
- }
-
- func fetchAll() -> [CustomList] {
- customRelayLists
- }
-}
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift
index 995b612e22..42957d24d6 100644
--- a/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift
+++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationDataSource.swift
@@ -35,10 +35,7 @@ final class LocationDataSource:
let sections: [LocationSection] = LocationSection.allCases
self.sections = sections
- #if DEBUG
- self.dataSources.append(customLists)
- #endif
- self.dataSources.append(allLocations)
+ self.dataSources.append(contentsOf: [customLists, allLocations])
super.init(tableView: tableView) { _, indexPath, itemIdentifier in
let cell = tableView.dequeueReusableView(
diff --git a/ios/MullvadVPN/View controllers/SelectLocation/LocationSection.swift b/ios/MullvadVPN/View controllers/SelectLocation/LocationSection.swift
index 51c4d00305..87dc2dbb53 100644
--- a/ios/MullvadVPN/View controllers/SelectLocation/LocationSection.swift
+++ b/ios/MullvadVPN/View controllers/SelectLocation/LocationSection.swift
@@ -31,12 +31,4 @@ enum LocationSection: String, Hashable, CustomStringConvertible, CaseIterable, C
var cellClass: AnyClass {
LocationCell.self
}
-
- static var allCases: [LocationSection] {
- #if DEBUG
- return [.customLists, .allLocations]
- #else
- return [.allLocations]
- #endif
- }
}