From 5caf9231d456cadeb0f83fb69602b3bc6e433710 Mon Sep 17 00:00:00 2001 From: Adithya Vardhan Date: Wed, 29 Jun 2022 22:46:17 +0530 Subject: [PATCH] fix: commenting issue after ts migration (#2558) --- packages/lexical-playground/src/commenting/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/lexical-playground/src/commenting/index.ts b/packages/lexical-playground/src/commenting/index.ts index 592350f0b46..833ced73835 100644 --- a/packages/lexical-playground/src/commenting/index.ts +++ b/packages/lexical-playground/src/commenting/index.ts @@ -362,9 +362,11 @@ export class CommentStore { map.get('timeStamp'), ); this._withLocalTransaction(() => { - if (parentThread !== undefined && parentThread !== false) { - this.addComment(commentOrThread, parentThread, offset); - } + this.addComment( + commentOrThread, + parentThread as Thread, + offset, + ); }); }); } else if (typeof retain === 'number') { @@ -376,9 +378,7 @@ export class CommentStore { ? this._comments[offset] : parentThread.comments[offset]; this._withLocalTransaction(() => { - if (parentThread !== undefined && parentThread !== false) { - this.deleteComment(commentOrThread, parentThread); - } + this.deleteComment(commentOrThread, parentThread as Thread); }); offset++; }