diff --git a/Tusker/Views/Status/BaseStatusTableViewCell.swift b/Tusker/Views/Status/BaseStatusTableViewCell.swift index f8d8c61c..affc26e4 100644 --- a/Tusker/Views/Status/BaseStatusTableViewCell.swift +++ b/Tusker/Views/Status/BaseStatusTableViewCell.swift @@ -87,6 +87,10 @@ class BaseStatusTableViewCell: UITableViewCell { accessibilityElements = [displayNameLabel!, contentWarningLabel!, collapseButton!, contentTextView!, attachmentsView!] attachmentsView.isAccessibilityElement = true + if #available(iOS 14.0, *) { + moreButton.showsMenuAsPrimaryAction = true + } + NotificationCenter.default.addObserver(self, selector: #selector(preferencesChanged), name: .preferencesChanged, object: nil) } @@ -178,11 +182,6 @@ class BaseStatusTableViewCell: UITableViewCell { collapsible = state.collapsible! setCollapsed(state.collapsed!, animated: false) } - - if #available(iOS 14.0, *) { - moreButton.showsMenuAsPrimaryAction = true - moreButton.menu = UIMenu(title: "", image: nil, identifier: nil, options: [], children: actionsForStatus(statusID: statusID, sourceView: moreButton)) - } } func updateStatusState(status: StatusMO) { @@ -199,6 +198,11 @@ class BaseStatusTableViewCell: UITableViewCell { } else { reblogButton.accessibilityLabel = NSLocalizedString("Reblog", comment: "reblog button accessibility label") } + + if #available(iOS 14.0, *) { + // keep menu in sync with changed states e.g. bookmarked, muted + moreButton.menu = UIMenu(title: "", image: nil, identifier: nil, options: [], children: actionsForStatus(statusID: statusID, sourceView: moreButton)) + } } func updateUI(account: AccountMO) {