Skip to content

Commit

Permalink
Fix restoring timeline position on refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodoering committed Nov 26, 2022
1 parent 723ce16 commit 14694c2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/components/timeline/provider/timeline_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ abstract class TimelineNotifier<T extends Object>
if (id >= tweetId) {
restoredTweet = tweets[i];
restoredTweetIndex = i;

// Break when finding the exact tweet, otherwise look for an older one
// that is still newer than `tweetId`.
// This prevents refreshing to falsely identify older tweets as the
// refreshTweet if the `tweetId` is from a Tweet that has replies
// which pushed it up in the timeline.
if (id == tweetId) break;
} else {
break;
}
Expand Down

0 comments on commit 14694c2

Please sign in to comment.