提交 78c37417 编写于 作者: P Peng Lyu

Fix #77663. first comment of a thread should have an unique id.

上级 70ab0ada
......@@ -23,7 +23,7 @@ export class CommentsDataSource implements IDataSource {
return `${element.owner}-${element.id}`;
}
if (element instanceof CommentNode) {
return `${element.owner}-${element.resource.toString()}-${element.threadId}-${element.comment.uniqueIdInThread}`;
return `${element.owner}-${element.resource.toString()}-${element.threadId}-${element.comment.uniqueIdInThread}` + (element.isRoot ? '-root' : '');
}
return '';
}
......
......@@ -21,6 +21,7 @@ export class CommentNode {
comment: Comment;
replies: CommentNode[] = [];
resource: URI;
isRoot: boolean;
constructor(owner: string, threadId: string, resource: URI, comment: Comment, range: IRange) {
this.owner = owner;
......@@ -28,6 +29,7 @@ export class CommentNode {
this.comment = comment;
this.resource = resource;
this.range = range;
this.isRoot = false;
}
hasReply(): boolean {
......@@ -55,6 +57,8 @@ export class ResourceWithCommentThreads {
commentNodes[0].replies = commentNodes.slice(1, commentNodes.length);
}
commentNodes[0].isRoot = true;
return commentNodes[0];
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册