iampueroo / rComments

Chrome and Firefox extension for quickly exploring Reddit comments and replies without having to click through to the post!
http://iampueroo.github.io/rComments/
38 stars 3 forks source link

Keep rendering comments until first non-stickied mod post is found #26

Open iampueroo opened 3 years ago

iampueroo commented 3 years ago

Summary

Upon the release of v1.3. rComments will automatically load the second comment if the first is a stickied/pinned moderator comment. There is an edge case when there are multiple pinned moderator comments. For example, see this post on /r/DrunkOrAKid.

Potential Solution

The two solutions are, in order of simplicity ~1. Recursively call the logic that identifies if a comment is a pinned moderator comment and executes the fetch of the next one. In this solution, we should have a limit of # of AJAX requests to fetch in a row, as well as be careful that the logic ONLY happens when the first comment is triggered from the subreddit page (as opposed to the "Next Reply" button).~

  1. Refactor the fetching/state logic so that we fetch n comments per request (for example, n=10) but the UI only renders the first m (where m <= n depending on # of pinned mod comments). This has been done, so this is quite easy now