From ddfb6227dd251a87e602a4ce9752b57f69733a63 Mon Sep 17 00:00:00 2001 From: Jon Petersson Date: Mon, 21 Oct 2024 11:13:49 +0200 Subject: [PATCH] Hide Daita section in settings when logged out --- .../View controllers/Settings/SettingsDataSource.swift | 9 ++++++--- .../VPNSettings/VPNSettingsDataSource.swift | 2 +- 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 59219e620568..3006be583bb4 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() - 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 4113ca8660ca..2aa5f6dd5679 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 } }