Skip to content

Commit bac56a1

Browse files
committed
Fix syncIfAppropriate
1 parent a0fdc59 commit bac56a1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

WordPress/Classes/ViewRelated/Reader/Controllers/ReaderDiscoverViewController.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,13 @@ private class ReaderDiscoverStreamViewController: ReaderStreamViewController {
310310
return cards?.count ?? 0
311311
}
312312

313+
override func syncIfAppropriate(forceSync: Bool = false) {
314+
// Only sync if the tableview is at the top, otherwise this will change tableview's offset
315+
if tableView.contentOffset.y <= 0 {
316+
super.syncIfAppropriate(forceSync: forceSync)
317+
}
318+
}
319+
313320
/// Track when the API returned the cards and the user is still on the screen
314321
/// This is used to create a funnel to check if users are leaving the screen
315322
/// before the API response

WordPress/Classes/ViewRelated/Reader/Controllers/ReaderStreamViewController.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,6 @@ import AutomatticTracks
177177

178178
private var showConfirmation = true
179179

180-
/// Tracks whether or not we should force sync
181-
/// This is set to true after the Reader Manage view is dismissed
182-
var shouldForceRefresh = false
183-
184180
var isEmbeddedInDiscover = false
185181

186182
private var isCompact = true {

0 commit comments

Comments
 (0)