Skip to content

Commit

Permalink
Hide the newly added comment.
Browse files Browse the repository at this point in the history
Also add a check for failed attempts of new comments.

Signed-off-by: Gökay Şatır <[email protected]>
Change-Id: I50a9981cf51475d6008e936e6e28573156a8383a
  • Loading branch information
gokaysatir authored and lpranam committed Oct 16, 2023
1 parent 84cc6dc commit d3d5bdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions browser/src/layer/tile/CalcTileLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 2 additions & 0 deletions browser/src/layer/tile/CommentListSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d3d5bdf

Please sign in to comment.