diff options
| author | Bug Magnet <marco.nikic@mullvad.net> | 2025-03-13 08:58:22 +0100 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2025-03-13 08:58:22 +0100 |
| commit | 6d355f18b8f9e7cf69035b91cef90b57a9f65d58 (patch) | |
| tree | b1c3e4e2deddcfe7c2a9a6d379803b272a854626 | |
| parent | e95eb342f3716caeb119bae24a04c27dafe1ec67 (diff) | |
| parent | 3cf404008dad4f5c8569c5024c08bccb9b0c7ff9 (diff) | |
| download | mullvadvpn-6d355f18b8f9e7cf69035b91cef90b57a9f65d58.tar.xz mullvadvpn-6d355f18b8f9e7cf69035b91cef90b57a9f65d58.zip | |
Merge branch 'ios-1051-use-custom-dns-label-constancy'
| -rw-r--r-- | ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift b/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift index c4f22e7b44..d620e101be 100644 --- a/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift +++ b/ios/MullvadVPN/View controllers/VPNSettings/CustomDNSDataSource.swift @@ -563,17 +563,13 @@ final class CustomDNSDataSource: UITableViewDiffableDataSource< ) -> NSDiffableDataSourceSnapshot<Section, Item> { var snapshot = snapshot - if snapshot.itemIdentifiers(inSection: .contentBlockers).isEmpty { + if viewModel.customDNSPrecondition == .satisfied { snapshot.deleteItems([.dnsServerInfo]) } else { - if viewModel.customDNSPrecondition == .satisfied { - snapshot.deleteItems([.dnsServerInfo]) + if snapshot.itemIdentifiers(inSection: .customDNS).contains(.dnsServerInfo) { + snapshot.reloadItems([.dnsServerInfo]) } else { - if snapshot.itemIdentifiers(inSection: .customDNS).contains(.dnsServerInfo) { - snapshot.reloadItems([.dnsServerInfo]) - } else { - snapshot.appendItems([.dnsServerInfo], toSection: .customDNS) - } + snapshot.appendItems([.dnsServerInfo], toSection: .customDNS) } } @@ -618,10 +614,8 @@ final class CustomDNSDataSource: UITableViewDiffableDataSource< if headerView.isExpanded { snapshot.deleteItems(Item.contentBlockers) - snapshot.deleteItems([.dnsServerInfo]) } else { snapshot.appendItems(Item.contentBlockers, toSection: .contentBlockers) - snapshot.appendItems([.dnsServerInfo]) } headerView.isExpanded.toggle() |
