Hide the newly added comment.

Also add a check for failed attempts of new comments.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I50a9981cf51475d6008e936e6e28573156a8383a
This commit is contained in:
Gökay Şatır 2023-10-16 19:28:36 +03:00 committed by Pranam Lashkari
parent 84cc6dc329
commit d3d5bdf269
2 changed files with 6 additions and 0 deletions

View file

@ -39,6 +39,10 @@ L.CalcTileLayer = L.CanvasTileLayer.extend({
dateTime: new Date().toDateString(),
author: this._map.getViewName(this._viewId)
};
if (app.sectionContainer.doesSectionExist(newComment.name)) // If adding a new comment has failed, we need to remove the leftover.
app.sectionContainer.removeSection(newComment.name);
comment = app.sectionContainer.getSectionWithName(L.CSections.CommentList.name).add(newComment);
comment.show();
}

View file

@ -1140,6 +1140,8 @@ export class CommentSection extends CanvasSectionObject {
this.adjustComment(obj.comment);
annotation = this.add(obj.comment);
this.adjustParentAdd(annotation);
if (this.sectionProperties.docLayer._docType === 'spreadsheet')
annotation.hide();
}
if (this.sectionProperties.selectedComment && !this.sectionProperties.selectedComment.isEdit()) {
this.map.focus();