From ccf7bb33308556860eacf098f023bf137458d3bc Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Tue, 24 Dec 2024 12:08:32 +0530 Subject: [PATCH] annotation: avoid comment conflict warning when irrelevan 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 Change-Id: I8578443f6f4e31f441c9e8ce4c77ec276d9a5d6a --- browser/src/canvas/sections/CommentListSection.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/browser/src/canvas/sections/CommentListSection.ts b/browser/src/canvas/sections/CommentListSection.ts index 139934c5f78fc..f5ecb3762b606 100644 --- a/browser/src/canvas/sections/CommentListSection.ts +++ b/browser/src/canvas/sections/CommentListSection.ts @@ -1477,6 +1477,10 @@ 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(); @@ -1484,7 +1488,8 @@ export class CommentSection extends app.definitions.canvasSectionObject { && !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; }