From 5a6c12c5a7e429904b14cd48a266b9434449e80b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 25 Jan 2020 10:29:38 -0500 Subject: [PATCH] Fix missing context menu actions on follow notifications for only one person --- .../FollowNotificationGroupTableViewCell.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Tusker/Views/Notifications/FollowNotificationGroupTableViewCell.swift b/Tusker/Views/Notifications/FollowNotificationGroupTableViewCell.swift index 26c825c136..aa112e75eb 100644 --- a/Tusker/Views/Notifications/FollowNotificationGroupTableViewCell.swift +++ b/Tusker/Views/Notifications/FollowNotificationGroupTableViewCell.swift @@ -142,15 +142,19 @@ extension FollowNotificationGroupTableViewCell: MenuPreviewProvider { func getPreviewProviders(for location: CGPoint, sourceViewController: UIViewController) -> PreviewProviders? { guard let mastodonController = mastodonController else { return nil } + let accountIDs = self.group.notificationIDs.compactMap(mastodonController.cache.notification(for:)).map { $0.account.id } return (content: { - let accountIDs = self.group.notificationIDs.compactMap(mastodonController.cache.notification(for:)).map { $0.account.id } if accountIDs.count == 1 { return ProfileTableViewController(accountID: accountIDs.first!, mastodonController: mastodonController) } else { return AccountListTableViewController(accountIDs: accountIDs, mastodonController: mastodonController) } }, actions: { - return [] + if accountIDs.count == 1 { + return self.actionsForProfile(accountID: accountIDs.first!, sourceView: self) + } else { + return [] + } }) } }