summaryrefslogtreecommitdiffhomepage
path: root/ios
diff options
context:
space:
mode:
authorJon Petersson <jon.petersson@mullvad.net>2024-10-21 11:13:49 +0200
committerJon Petersson <jon.petersson@mullvad.net>2024-10-21 11:13:49 +0200
commitddfb6227dd251a87e602a4ce9752b57f69733a63 (patch)
treefe1cc8c908e2fa96bc56934f877238e10503d0e7 /ios
parent36a6113532915aade3ca904e05791557608df228 (diff)
downloadmullvadvpn-ddfb6227dd251a87e602a4ce9752b57f69733a63.tar.xz
mullvadvpn-ddfb6227dd251a87e602a4ce9752b57f69733a63.zip
Hide Daita section in settings when logged out
Diffstat (limited to 'ios')
-rw-r--r--ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift9
-rw-r--r--ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift2
2 files changed, 7 insertions, 4 deletions
diff --git a/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift b/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift
index 59219e6205..3006be583b 100644
--- a/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift
+++ b/ios/MullvadVPN/View controllers/Settings/SettingsDataSource.swift
@@ -155,7 +155,7 @@ final class SettingsDataSource: UITableViewDiffableDataSource<SettingsDataSource
return switch sectionIdentifier {
case .main:
- 0
+ interactor.deviceState.isLoggedIn ? 0 : UITableView.automaticDimension
case .daita, .version, .problemReport:
UITableView.automaticDimension
}
@@ -173,7 +173,6 @@ final class SettingsDataSource: UITableViewDiffableDataSource<SettingsDataSource
contentConfiguration.text = sectionFooterText
headerView.contentConfiguration = contentConfiguration
-// headerView.directionalLayoutMargins = UIMetrics.SettingsCell.apiAccessInsetLayoutMargins
return headerView
}
@@ -210,7 +209,11 @@ final class SettingsDataSource: UITableViewDiffableDataSource<SettingsDataSource
private func updateDataSnapshot() {
var snapshot = NSDiffableDataSourceSnapshot<Section, Item>()
- snapshot.appendSections([.daita, .main])
+ if interactor.deviceState.isLoggedIn {
+ snapshot.appendSections([.daita])
+ }
+
+ snapshot.appendSections([.main])
if interactor.deviceState.isLoggedIn {
snapshot.appendItems([.daita], toSection: .daita)
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift
index 4113ca8660..2aa5f6dd56 100644
--- a/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift
+++ b/ios/MullvadVPN/View controllers/VPNSettings/VPNSettingsDataSource.swift
@@ -374,7 +374,7 @@ final class VPNSettingsDataSource: UITableViewDiffableDataSource<
return switch sectionIdentifier {
// 0 due to there already being a separator between .dnsSettings and .ipOverrides.
case .dnsSettings: 0
- case .ipOverrides, .quantumResistance: UIMetrics.TableView.sectionSpacing
+ case .ipOverrides, .quantumResistance: UITableView.automaticDimension
default: 0.5
}
}