Hide context menus and swipe actions on instance public timelines
This commit is contained in:
parent
7c207efa07
commit
6757031dcb
|
@ -77,6 +77,27 @@ class InstanceTimelineViewController: TimelineTableViewController {
|
|||
// no-op, we don't currently support viewing whole conversations from other instances
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
|
||||
// don't show other screens or actions for other instances
|
||||
return nil
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
|
||||
// don't show swipe actions for other instances
|
||||
return nil
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {
|
||||
// only show more actions for other instances
|
||||
let more = UIContextualAction(style: .normal, title: "More") { (action, view, completion) in
|
||||
completion(true)
|
||||
self.showMoreOptions(forStatus: self.timelineSegments[indexPath.section][indexPath.row].id, sourceView: tableView.cellForRow(at: indexPath))
|
||||
}
|
||||
more.image = UIImage(systemName: "ellipsis.circle.fill")
|
||||
more.backgroundColor = .lightGray
|
||||
return UISwipeActionsConfiguration(actions: [more])
|
||||
}
|
||||
|
||||
// MARK: - Interaction
|
||||
@objc func toggleSaveButtonPressed() {
|
||||
if SavedDataManager.shared.isSaved(instance: instanceURL, for: parentMastodonController!.accountInfo!) {
|
||||
|
|
Loading…
Reference in New Issue