Skip to content

Commit

Permalink
Make thumbnails for internal news.ycombinator.com posts tappable
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
  • Loading branch information
claucambra authored and weiran committed Dec 5, 2024
1 parent 13d7b20 commit 3cc0da7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions App/Feed/FeedCollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ extension FeedCollectionViewController: UICollectionViewDelegate {
cell.setupThumbnail(with: UserDefaults.standard.showThumbnails ? post.url : nil)

cell.linkPressedHandler = { post in
guard !post.url.absoluteString.starts(with: "item?id=") else {
self.collectionView.selectItem(at: indexPath, animated: true)
self.performSegue(withIdentifier: "ShowCommentsSegue", sender: self)
return
}

self.openURL(url: post.url) {
if let svc = SFSafariViewController.instance(for: post.url) {
self.navigationController?.present(svc, animated: true)
Expand Down

0 comments on commit 3cc0da7

Please sign in to comment.