Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iampueroo opened this issue Jun 16, 2021 · 0 comments
Open

Comments

@iampueroo
Copy link
Owner

iampueroo commented Jun 16, 2021

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).
2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant