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

CommentForest.length does not include entries expanded from MoreComments #61

Open
bkonyi opened this issue Apr 18, 2018 · 5 comments
Open

Comments

@bkonyi
Copy link
Member

bkonyi commented Apr 18, 2018

This needs to be fixed and additional tests need to be written for comment related functionality.

@Bricktheworld
Copy link

Any update on this?

@Bricktheworld
Copy link

Bricktheworld commented Apr 5, 2020

This actually really needs to have some fix to it, because as it stands, I have a list view however when I set the number of items, I always receive an error with there being a more comments option. I would at the very least like an option to detect if there are any "more comments" as a way to ensure that I can get 1 minus the length of the comment forest. Any way I can achieve this?

@Bricktheworld
Copy link

Ok, have found a solution. Simply check if an element is MoreComment with "if (someCommentForest[index] is MoreComment) "...

I wonder if that would be easy to check in the actual ".length" property in the CommentForest, might make a pull request for that

@SupremeDeity
Copy link
Contributor

SupremeDeity commented Aug 14, 2021

There needs to be a way to find total comments, because the field on CommentForest is wrong, as it probably doesnt contain replies.

@SupremeDeity
Copy link
Contributor

SupremeDeity commented Aug 14, 2021

This actually really needs to have some fix to it, because as it stands, I have a list view however when I set the number of items, I always receive an error with there being a more comments option. I would at the very least like an option to detect if there are any "more comments" as a way to ensure that I can get 1 minus the length of the comment forest. Any way I can achieve this?

I dont know what you are doing but you need to call refreshComments() and use the length field. on it. This is the number of top-level comments(without the replies). The num_comments field is supposed to show total comments. Since i have a custom implementation of a treeview for my app, i only the top-level comments length so this works for me.

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

3 participants