Skip to content

Commit

Permalink
Reader - scroll to the last known position only when the view first a…
Browse files Browse the repository at this point in the history
…ppears (#1114)

fix(reader): scroll to the last known position only when the view first appears
  • Loading branch information
Gio2018 authored Nov 15, 2024
1 parent 98862f4 commit a38b750
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ class ReadableViewController: UIViewController {

private var isReloading = false

var hasAppearedAfterLoading = false

private var userScrollProgress: IndexPath?
// Tippable view controller properties
var tipObservationTask: Task<Void, Error>?
Expand Down Expand Up @@ -353,7 +355,10 @@ class ReadableViewController: UIViewController {

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
scrollToLastKnownPosition()
if !hasAppearedAfterLoading {
scrollToLastKnownPosition()
hasAppearedAfterLoading = true
}
// do not vend the tip on syndicated articles
if readableViewModel is SavedItemViewModel {
PocketTipEvents.showSwipeHighlightsTip.sendDonation()
Expand Down

0 comments on commit a38b750

Please sign in to comment.