Skip to content

Commit

Permalink
Merge branch 'explanatory-text-for-daita-not-hidden-when-logged-out-i…
Browse files Browse the repository at this point in the history
…os-887'
  • Loading branch information
buggmagnet committed Oct 21, 2024
2 parents 36a6113 + ddfb622 commit de12dc2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -173,7 +173,6 @@ final class SettingsDataSource: UITableViewDiffableDataSource<SettingsDataSource
contentConfiguration.text = sectionFooterText

headerView.contentConfiguration = contentConfiguration
// headerView.directionalLayoutMargins = UIMetrics.SettingsCell.apiAccessInsetLayoutMargins

return headerView
}
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit de12dc2

Please sign in to comment.