From 88f9ad09a2ae8016757395112c35d7051ab7e6d2 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Thu, 6 Jan 2022 17:19:05 +0530 Subject: [PATCH] Move method as local function --- .../web/ui/session/room/timeline/TextMessageView.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/platform/web/ui/session/room/timeline/TextMessageView.js b/src/platform/web/ui/session/room/timeline/TextMessageView.js index 574016cf..0d9ea83b 100644 --- a/src/platform/web/ui/session/room/timeline/TextMessageView.js +++ b/src/platform/web/ui/session/room/timeline/TextMessageView.js @@ -39,8 +39,10 @@ export class TextMessageView extends BaseMessageView { } })); + const shouldRemove = (element) => element && element.className !== "ReplyPreviewView" && element.nodeName !== "#comment"; + t.mapSideEffect(vm => vm.body, body => { - while (this._shouldRemove(container.lastChild)) { + while (shouldRemove(container.lastChild)) { container.removeChild(container.lastChild); } for (const part of body.parts) { @@ -52,9 +54,6 @@ export class TextMessageView extends BaseMessageView { return container; } - _shouldRemove(element) { - return element && element.className !== "ReplyPreviewView" && element.nodeName !== "#comment"; - } }