From 746c06d147ae49c7d7370bdf66e1f487a62dba12 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 2 Sep 2019 12:05:11 -0500 Subject: [PATCH] Prevent automated scrolling when selecting an article in the timeline --- iOS/MasterTimeline/MasterTimelineViewController.swift | 2 +- iOS/SceneCoordinator.swift | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/iOS/MasterTimeline/MasterTimelineViewController.swift b/iOS/MasterTimeline/MasterTimelineViewController.swift index 6c1990462..d6f290ee5 100644 --- a/iOS/MasterTimeline/MasterTimelineViewController.swift +++ b/iOS/MasterTimeline/MasterTimelineViewController.swift @@ -270,7 +270,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - coordinator.selectArticle(indexPath) + coordinator.selectArticle(indexPath, automated: false) } // MARK: Notifications diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index ea3e5587d..1f7dccaad 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -501,7 +501,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider { selectArticle(nil) } - func selectArticle(_ indexPath: IndexPath?) { + func selectArticle(_ indexPath: IndexPath?, automated: Bool = true) { currentArticleIndexPath = indexPath activityManager.reading(currentArticle) @@ -531,7 +531,10 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider { rootSplitViewController.preferredDisplayMode = .automatic } - masterTimelineViewController?.updateArticleSelection(animate: true) + if automated { + masterTimelineViewController?.updateArticleSelection(animate: true) + } + detailViewController?.updateArticleSelection() }