Skip to content

Commit

Permalink
fix unused tag defaulting to 'Show Email'
Browse files Browse the repository at this point in the history
as 'Show Email' has randomly the value 0,
which is the same iOS assignes by default,
tapping on some switch cells opens 'Show Email'.

we fix this by explicitly adding a defaultTagValue that is zero.
  • Loading branch information
r10s committed May 15, 2024
1 parent 0544584 commit f00df2d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler
}

private enum CellTags: Int {
case defaultTagValue = 0
case showEmails
case autocryptPreferences
case sendAutocryptMessage
case manageKeys
case videoChat
Expand Down Expand Up @@ -49,7 +49,6 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler

private lazy var autocryptPreferencesCell: UITableViewCell = {
let cell = UITableViewCell(style: .default, reuseIdentifier: nil)
cell.tag = CellTags.autocryptPreferences.rawValue
cell.textLabel?.text = String.localized("autocrypt_prefer_e2ee")
cell.accessoryView = autocryptSwitch
cell.selectionStyle = .none
Expand Down Expand Up @@ -307,12 +306,12 @@ internal final class AdvancedViewController: UITableViewController, ProgressAler

switch cellTag {
case .showEmails: showClassicMailController()
case .autocryptPreferences: break
case .sendAutocryptMessage: sendAutocryptSetupMessage()
case .manageKeys: showManageKeysDialog()
case .videoChat: showVideoChatInstance()
case .viewLog: showLogViewController()
case .accountSettings: showAccountSettingsController()
case .defaultTagValue: break
}
}

Expand Down

0 comments on commit f00df2d

Please sign in to comment.