Skip to content

Commit

Permalink
annotation: avoid comment conflict warning when irrelevan
Browse files Browse the repository at this point in the history
avoid comment conflict dialog when changes are done by current user itself

problem:
when autosaved comments are still in edit mode and user undo the comment action
user used to get warning "another user removed comment"

Signed-off-by: Pranam Lashkari <[email protected]>
Change-Id: I8578443f6f4e31f441c9e8ce4c77ec276d9a5d6a
  • Loading branch information
lpranam committed Dec 24, 2024
1 parent 3243d0d commit ccf7bb3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion browser/src/canvas/sections/CommentListSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1477,14 +1477,19 @@ export class CommentSection extends app.definitions.canvasSectionObject {
return false;
}

private actionPerformedByCurrentUser(obj: any): boolean {
return obj.comment.author === this.map._viewInfo[this.map._docLayer._editorId].username;
}

public onACKComment (obj: any): void {
var id;
const anyEdit = Comment.isAnyEdit();
if (anyEdit
&& !this.checkIfOnlyAnchorPosChanged(obj, anyEdit)
&& !anyEdit.sectionProperties.selfRemoved
&& anyEdit.sectionProperties.data.id === obj.comment.id
&& CommentSection.autoSavedComment !== anyEdit) {
&& CommentSection.autoSavedComment !== anyEdit
&& !this.actionPerformedByCurrentUser(obj)) {
this.handleCommentConflict(obj, anyEdit);
return;
}
Expand Down

0 comments on commit ccf7bb3

Please sign in to comment.