From 4d0fd5db791a32e375d7774c9038578f5c1166bb Mon Sep 17 00:00:00 2001 From: Chang Min Bark <88669927+changminbark@users.noreply.github.com> Date: Tue, 3 Sep 2024 23:12:40 +0700 Subject: [PATCH] fix(comments): added workspace comments and comment drag strategy isDeadOrDying() checks (#8532) * fix: added id to rendered ws comments; made getCommentById public; added blocklyDraggable class to ws comments * fix: added workspace comments and comment drag strategy isDeadOrDying checks * chore: removed .idea files * chore: formatted with prettier --- core/comments/workspace_comment.ts | 6 +++++- core/dragging/comment_drag_strategy.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/comments/workspace_comment.ts b/core/comments/workspace_comment.ts index bda77f28c..2d59c715e 100644 --- a/core/comments/workspace_comment.ts +++ b/core/comments/workspace_comment.ts @@ -184,7 +184,11 @@ export class WorkspaceComment { * workspace is read-only. */ isDeletable(): boolean { - return this.isOwnDeletable() && !this.workspace.options.readOnly; + return ( + this.isOwnDeletable() && + !this.isDeadOrDying() && + !this.workspace.options.readOnly + ); } /** diff --git a/core/dragging/comment_drag_strategy.ts b/core/dragging/comment_drag_strategy.ts index bc48c0e6c..dd8b10fc2 100644 --- a/core/dragging/comment_drag_strategy.ts +++ b/core/dragging/comment_drag_strategy.ts @@ -26,7 +26,11 @@ export class CommentDragStrategy implements IDragStrategy { } isMovable(): boolean { - return this.comment.isOwnMovable() && !this.workspace.options.readOnly; + return ( + this.comment.isOwnMovable() && + !this.comment.isDeadOrDying() && + !this.workspace.options.readOnly + ); } startDrag(): void {