diff --git a/Client/Frontend/Settings/Main/Account/SyncNowSetting.swift b/Client/Frontend/Settings/Main/Account/SyncNowSetting.swift index 6100be319488..4ad94fa26357 100644 --- a/Client/Frontend/Settings/Main/Account/SyncNowSetting.swift +++ b/Client/Frontend/Settings/Main/Account/SyncNowSetting.swift @@ -239,10 +239,12 @@ class SyncNowSetting: WithAccountSetting { } private func addAccessoryView(with image: UIImageView, to cell: UITableViewCell) { - accessoryViewContainer.addArrangedSubview(image) - accessoryViewContainer.addArrangedSubview(troubleshootButton) - - cell.accessoryView = accessoryViewContainer + DispatchQueue.main.async { [weak self] in + guard let troubleshootButton = self?.troubleshootButton else { return } + self?.accessoryViewContainer.addArrangedSubview(image) + self?.accessoryViewContainer.addArrangedSubview(troubleshootButton ) + cell.accessoryView = self?.accessoryViewContainer + } } override func onClick(_ navigationController: UINavigationController?) { diff --git a/Client/Frontend/Settings/SettingsTableViewController.swift b/Client/Frontend/Settings/SettingsTableViewController.swift index 49249112f6ef..1c8a8ee2053c 100644 --- a/Client/Frontend/Settings/SettingsTableViewController.swift +++ b/Client/Frontend/Settings/SettingsTableViewController.swift @@ -830,12 +830,19 @@ class SettingsTableViewController: ThemedTableViewController { if let setting = section[indexPath.row] { let cell = dequeueCellFor(indexPath: indexPath, setting: setting) setting.onConfigureCell(cell, theme: themeManager.currentTheme) - cell.applyTheme(theme: themeManager.currentTheme) return cell } return super.tableView(tableView, cellForRowAt: indexPath) } + override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { + let section = settings[indexPath.section] + if let setting = section[indexPath.row], let themedCell = cell as? ThemedTableViewCell { + setting.onConfigureCell(themedCell, theme: themeManager.currentTheme) + themedCell.applyTheme(theme: themeManager.currentTheme) + } + } + private func dequeueCellFor(indexPath: IndexPath, setting: Setting) -> ThemedTableViewCell { if setting.style == .subtitle { guard let cell = tableView.dequeueReusableCell(withIdentifier: ThemedSubtitleTableViewCell.cellIdentifier, for: indexPath) as? ThemedSubtitleTableViewCell else {