Skip to content

Commit

Permalink
Bugfix FXIOS-7498 [v119] Crash when adding icon to sync now setting (#…
Browse files Browse the repository at this point in the history
…17151) (#17176)

* Bugfix FXIOS-7498 [v121] Crash when adding icon to sync now setting (#16644)

* addressed PR comments

---------

Co-authored-by: Stefan Vladut <[email protected]>
(cherry picked from commit e76a521)

Co-authored-by: petruSt24 <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
mergify[bot] and petruSt24 authored Nov 6, 2023
1 parent 62d6b25 commit 2dbdb46
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Client/Frontend/Settings/Main/Account/SyncNowSetting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?) {
Expand Down
9 changes: 8 additions & 1 deletion Client/Frontend/Settings/SettingsTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

1 comment on commit 2dbdb46

@firefoxci-taskcluster
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! Looks like an error! Details

InterpreterError at template.tasks[0].extra[0].treeherder[1].symbol: unknown context value cron

Please sign in to comment.