forked from shadowfacts/Tusker
Fix missing context menu actions on follow notifications for only one person
This commit is contained in:
parent
d6ae51c02f
commit
5a6c12c5a7
|
@ -142,15 +142,19 @@ extension FollowNotificationGroupTableViewCell: MenuPreviewProvider {
|
||||||
|
|
||||||
func getPreviewProviders(for location: CGPoint, sourceViewController: UIViewController) -> PreviewProviders? {
|
func getPreviewProviders(for location: CGPoint, sourceViewController: UIViewController) -> PreviewProviders? {
|
||||||
guard let mastodonController = mastodonController else { return nil }
|
guard let mastodonController = mastodonController else { return nil }
|
||||||
|
let accountIDs = self.group.notificationIDs.compactMap(mastodonController.cache.notification(for:)).map { $0.account.id }
|
||||||
return (content: {
|
return (content: {
|
||||||
let accountIDs = self.group.notificationIDs.compactMap(mastodonController.cache.notification(for:)).map { $0.account.id }
|
|
||||||
if accountIDs.count == 1 {
|
if accountIDs.count == 1 {
|
||||||
return ProfileTableViewController(accountID: accountIDs.first!, mastodonController: mastodonController)
|
return ProfileTableViewController(accountID: accountIDs.first!, mastodonController: mastodonController)
|
||||||
} else {
|
} else {
|
||||||
return AccountListTableViewController(accountIDs: accountIDs, mastodonController: mastodonController)
|
return AccountListTableViewController(accountIDs: accountIDs, mastodonController: mastodonController)
|
||||||
}
|
}
|
||||||
}, actions: {
|
}, actions: {
|
||||||
return []
|
if accountIDs.count == 1 {
|
||||||
|
return self.actionsForProfile(accountID: accountIDs.first!, sourceView: self)
|
||||||
|
} else {
|
||||||
|
return []
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue