mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-07 20:31:33 +08:00
fix(editor): time issues of comment initialization (#13031)
#### PR Dependency Tree * **PR #13031** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added the ability to filter comments by their resolution status (resolved, unresolved, or all) when viewing or managing comments. * **Refactor** * Improved the way commented text is identified and retrieved, resulting in more reliable comment selection and filtering. * Enhanced comment retrieval to support asynchronous data loading, ensuring up-to-date comment information. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -138,8 +138,10 @@ class AffineCommentService implements CommentProvider {
|
||||
this.commentEntity.highlightComment(id);
|
||||
}
|
||||
|
||||
getComments(): string[] {
|
||||
return this.commentEntity.getComments();
|
||||
async getComments(
|
||||
type: 'resolved' | 'unresolved' | 'all' = 'all'
|
||||
): Promise<string[]> {
|
||||
return this.commentEntity.getComments(type);
|
||||
}
|
||||
|
||||
onCommentAdded(callback: (id: string, selections: BaseSelection[]) => void) {
|
||||
|
||||
Reference in New Issue
Block a user