From f00df2dd249865633f93319e6d782f4c407395d6 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Wed, 15 May 2024 14:32:13 +0200 Subject: [PATCH] fix unused tag defaulting to 'Show Email' 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. --- .../Controller/Settings/AdvancedViewController.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deltachat-ios/Controller/Settings/AdvancedViewController.swift b/deltachat-ios/Controller/Settings/AdvancedViewController.swift index 5cc4fb526..4d9b14834 100644 --- a/deltachat-ios/Controller/Settings/AdvancedViewController.swift +++ b/deltachat-ios/Controller/Settings/AdvancedViewController.swift @@ -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 @@ -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 @@ -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 } }