Refactor the ArticleThemeManager code to simplify it and try to avoid any issues with app warm up on the iPhone

This commit is contained in:
Maurice Parker
2022-10-03 13:23:11 -05:00
parent 2e21018924
commit be75bd28d0
2 changed files with 13 additions and 43 deletions

View File

@@ -72,9 +72,9 @@ class ArticleThemesTableViewController: UITableViewController, Logging {
override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
guard let cell = tableView.cellForRow(at: indexPath),
let themeName = cell.textLabel?.text,
let theme = ArticleThemesManager.shared.articleThemeWithThemeName(themeName),
!theme.isAppTheme else { return nil }
let themeName = cell.textLabel?.text else { return nil }
guard !ArticleThemesManager.shared.articleThemeWithThemeName(themeName).isAppTheme else { return nil }
let deleteTitle = NSLocalizedString("Delete", comment: "Delete")
let deleteAction = UIContextualAction(style: .normal, title: deleteTitle) { [weak self] (action, view, completion) in