summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMert Tumer <mert.tumer@collabora.com>2022-02-14 12:40:10 +0300
committerGökay ŞATIR <gokaysatir@gmail.com>2022-02-15 13:27:58 +0300
commit3d85f153bd60d3dde73b88eec7f8736df081c87d (patch)
tree10adcb0ae7be1791c13d9cc9a151cbffe93038b0
parentIcon update for sidebar (diff)
downloadonline-3d85f153bd60d3dde73b88eec7f8736df081c87d.tar.gz
online-3d85f153bd60d3dde73b88eec7f8736df081c87d.zip
fix copy comments breaking the canvassection completely
core sends same id for copy comments and this breaks the existing implementation because sections are named based on the id. Signed-off-by: Mert Tumer <mert.tumer@collabora.com> Change-Id: Ia410227b7a42ac8ea7682f12aa980b34ee5c940b
-rw-r--r--browser/src/layer/tile/CommentListSection.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/browser/src/layer/tile/CommentListSection.ts b/browser/src/layer/tile/CommentListSection.ts
index a16c03df91..36efc66cad 100644
--- a/browser/src/layer/tile/CommentListSection.ts
+++ b/browser/src/layer/tile/CommentListSection.ts
@@ -923,7 +923,8 @@ class CommentSection {
this.showHideComment(annotation);
}
else {
- this.containerObject.addSection(annotation);
+ if (!this.containerObject.addSection(annotation))
+ return;
this.sectionProperties.commentList.push(annotation);
}
@@ -1699,7 +1700,8 @@ class CommentSection {
comment.avatar = this.map._viewInfoByUserName[comment.author].userextrainfo.avatar;
}
var commentSection = new app.definitions.Comment(comment, {}, this);
- this.containerObject.addSection(commentSection);
+ if (!this.containerObject.addSection(commentSection))
+ continue;
this.sectionProperties.commentList.push(commentSection);
this.idIndexMap.set(commentSection.sectionProperties.data.id, i);
this.updateResolvedState(this.sectionProperties.commentList[i]);