From e869fdc38f4e7421f4aa5b83993cdead6b328acf Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 23 Nov 2024 10:52:17 -0500 Subject: [PATCH] Disallow more interactions on non-browsable public instance timeline --- .../Timeline/InstanceTimelineViewController.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tusker/Screens/Timeline/InstanceTimelineViewController.swift b/Tusker/Screens/Timeline/InstanceTimelineViewController.swift index 4c565c00..9ec314d9 100644 --- a/Tusker/Screens/Timeline/InstanceTimelineViewController.swift +++ b/Tusker/Screens/Timeline/InstanceTimelineViewController.swift @@ -77,11 +77,25 @@ class InstanceTimelineViewController: TimelineViewController { cell.updateUI(statusID: id, state: state, filterResult: filterResult, precomputedContent: precomputedContent) } + override func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool { + guard browsingEnabled else { + return false + } + return super.collectionView(collectionView, shouldSelectItemAt: indexPath) + } + override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { guard browsingEnabled else { return } super.collectionView(collectionView, didSelectItemAt: indexPath) } + override func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? { + guard browsingEnabled else { + return nil + } + return super.collectionView(collectionView, contextMenuConfigurationForItemAt: indexPath, point: point) + } + // MARK: Timeline override func handleLoadAllError(_ error: Swift.Error) async {