summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2023-04-20 15:13:26 +0200
committerAndrej Mihajlov <and@mullvad.net>2023-04-20 15:13:26 +0200
commit20dc23d27b12d381f819839ff6fb1ae27cc2fc9e (patch)
treecd6e1a181fcd8d663b95c7170f353afe5834ac6d
parent48fd4f3ec4b114869de8d80861d9097645783279 (diff)
parent6cca36fd8072c12b6713f7fc7b8c45a6ad4442ce (diff)
downloadmullvadvpn-20dc23d27b12d381f819839ff6fb1ae27cc2fc9e.tar.xz
mullvadvpn-20dc23d27b12d381f819839ff6fb1ae27cc2fc9e.zip
Merge branch 'fix/device-in-name-in-header-bar-should-be-ios-115'
-rw-r--r--ios/MullvadVPN/Coordinators/App/ApplicationCoordinator.swift2
-rw-r--r--ios/MullvadVPN/SettingsManager/TunnelSettingsV2.swift4
-rw-r--r--ios/MullvadVPN/View controllers/DeviceList/DeviceManagementViewController.swift12
-rw-r--r--ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift2
4 files changed, 10 insertions, 10 deletions
diff --git a/ios/MullvadVPN/Coordinators/App/ApplicationCoordinator.swift b/ios/MullvadVPN/Coordinators/App/ApplicationCoordinator.swift
index fa6e879240..b0bb6c97bc 100644
--- a/ios/MullvadVPN/Coordinators/App/ApplicationCoordinator.swift
+++ b/ios/MullvadVPN/Coordinators/App/ApplicationCoordinator.swift
@@ -651,7 +651,7 @@ final class ApplicationCoordinator: Coordinator, Presenting, RootContainerViewCo
private func updateView(deviceState: DeviceState) {
let configuration = RootConfigration(
- deviceName: deviceState.deviceData?.name,
+ deviceName: deviceState.deviceData?.capitalizedName,
expiry: deviceState.accountData?.expiry,
showsAccountButton: deviceState.isLoggedIn
)
diff --git a/ios/MullvadVPN/SettingsManager/TunnelSettingsV2.swift b/ios/MullvadVPN/SettingsManager/TunnelSettingsV2.swift
index 87fe59833e..b9dca0bf21 100644
--- a/ios/MullvadVPN/SettingsManager/TunnelSettingsV2.swift
+++ b/ios/MullvadVPN/SettingsManager/TunnelSettingsV2.swift
@@ -108,6 +108,10 @@ struct StoredDeviceData: Codable, Equatable {
/// WireGuard key data.
var wgKeyData: StoredWgKeyData
+
+ var capitalizedName: String {
+ name.capitalized
+ }
}
struct StoredWgKeyData: Codable, Equatable {
diff --git a/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementViewController.swift b/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementViewController.swift
index d3b0d006da..ff64a5ea43 100644
--- a/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementViewController.swift
+++ b/ios/MullvadVPN/View controllers/DeviceList/DeviceManagementViewController.swift
@@ -104,7 +104,7 @@ class DeviceManagementViewController: UIViewController, RootContainment {
let viewModels = devices.map { restDevice -> DeviceViewModel in
return DeviceViewModel(
id: restDevice.id,
- name: restDevice.name
+ name: restDevice.name.capitalized
)
}
@@ -116,7 +116,7 @@ class DeviceManagementViewController: UIViewController, RootContainment {
_ device: DeviceViewModel,
completionHandler: @escaping () -> Void
) {
- showDeleteConfirmation(deviceName: device.displayName) { [weak self] shouldDelete in
+ showDeleteConfirmation(deviceName: device.name) { [weak self] shouldDelete in
guard let self = self else { return }
guard shouldDelete else {
@@ -261,10 +261,6 @@ class DeviceManagementViewController: UIViewController, RootContainment {
}
struct DeviceViewModel {
- var id: String
- var name: String
-
- var displayName: String {
- return name.capitalized
- }
+ let id: String
+ let name: String
}
diff --git a/ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift b/ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift
index ac638f47ab..10a768c4fd 100644
--- a/ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift
+++ b/ios/MullvadVPN/View controllers/DeviceList/DeviceRowView.swift
@@ -69,7 +69,7 @@ class DeviceRowView: UIView {
addSubview(subview)
}
- textLabel.text = viewModel.displayName
+ textLabel.text = viewModel.name
removeButton.addTarget(self, action: #selector(handleButtonTap(_:)), for: .touchUpInside)