From aa7eda472b799a1aad1992b30168b14c53950435 Mon Sep 17 00:00:00 2001 From: Mert Tumer Date: Tue, 29 Mar 2022 11:56:08 +0300 Subject: [PATCH] fix trackchange comments are not displayed on docload fix typo on clearList loop that prevents skipping trackchange comments from being deleted Also I removed the line in WriterTileLayer.js containing clearList because clearList is already called on importComments function so it was unnecessary Signed-off-by: Mert Tumer Change-Id: Ic4086a80b126aec62e382078f53d68bc17da8a1c --- browser/src/layer/tile/CommentListSection.ts | 4 ++-- browser/src/layer/tile/WriterTileLayer.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/browser/src/layer/tile/CommentListSection.ts b/browser/src/layer/tile/CommentListSection.ts index c7136ea17..c08a6577b 100644 --- a/browser/src/layer/tile/CommentListSection.ts +++ b/browser/src/layer/tile/CommentListSection.ts @@ -1757,7 +1757,7 @@ class CommentSection { private clearChanges() { this.containerObject.pauseDrawing(); for (var i: number = this.sectionProperties.commentList.length -1; i > -1; i--) { - if (this.sectionProperties.commentList[i].trackchange) { + if (this.sectionProperties.commentList[i].sectionProperties.data.trackchange) { this.containerObject.removeSection(this.sectionProperties.commentList[i].name); this.sectionProperties.commentList.splice(i, 1); } @@ -1773,7 +1773,7 @@ class CommentSection { private clearList () { this.containerObject.pauseDrawing(); for (var i: number = this.sectionProperties.commentList.length -1; i > -1; i--) { - if (!this.sectionProperties.commentList[i].trackchange) { + if (!this.sectionProperties.commentList[i].sectionProperties.data.trackchange) { this.containerObject.removeSection(this.sectionProperties.commentList[i].name); this.sectionProperties.commentList.splice(i, 1); } diff --git a/browser/src/layer/tile/WriterTileLayer.js b/browser/src/layer/tile/WriterTileLayer.js index 683a356d1..3a9501f8d 100644 --- a/browser/src/layer/tile/WriterTileLayer.js +++ b/browser/src/layer/tile/WriterTileLayer.js @@ -40,7 +40,6 @@ L.WriterTileLayer = L.CanvasTileLayer.extend({ comment.id = comment.id.toString(); comment.parent = comment.parent.toString(); }); - app.sectionContainer.getSectionWithName(L.CSections.CommentList.name).clearList(); app.sectionContainer.getSectionWithName(L.CSections.CommentList.name).importComments(values.comments); } else if (values.redlines && values.redlines.length > 0) {