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

[FEATURE] add sticky comment support #509

Merged
merged 6 commits into from
Sep 21, 2021
Merged

[FEATURE] add sticky comment support #509

merged 6 commits into from
Sep 21, 2021

Conversation

lizheming
Copy link
Collaborator

fix #307

@Mister-Hope
Copy link
Member

Mister-Hope commented Sep 20, 2021

Since the comment are loaded as clips, sticky comment should be returned under the first comment list request. And I see that in this PR, so just to make sure, do I need to do anything more to sort the return comment list? Or just rendering it as is?

@lizheming
Copy link
Collaborator Author

Since the comment are loaded as clips, sticky comment should be returned under the first comment list request. And I see that in this PR, so just to make sure, do I need to do anything more to sort the return comment list? Or just rendering it as is?

Comment list api will export sorted comments data, so client do not need do it.

rootComments.sort((cmtA, cmtB) => {
if (cmtA.sticky) {
return 1;
}
if (cmtB.sticky) {
return -1;
}
return 0;
});

@Mister-Hope
Copy link
Member

Should be ready ( not fully tested)

@lizheming lizheming merged commit e4225d3 into main Sep 21, 2021
@Mister-Hope Mister-Hope deleted the feature/sticky branch October 30, 2021 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]评论置顶功能
2 participants