From 3feaf38252595be95b4521b2a86da7dfd3f1a05e Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 6 Aug 2021 17:53:58 +0200 Subject: [PATCH] use internalId to compare so we don't have to cache the entry id separately --- src/domain/session/room/ComposerViewModel.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/domain/session/room/ComposerViewModel.js b/src/domain/session/room/ComposerViewModel.js index 1f98a21b..d3ee27a0 100644 --- a/src/domain/session/room/ComposerViewModel.js +++ b/src/domain/session/room/ComposerViewModel.js @@ -21,15 +21,12 @@ export class ComposerViewModel extends ViewModel { super(); this._roomVM = roomVM; this._isEmpty = true; - this._replyId = null; this._replyVM = null; } setReplyingTo(entry) { - const newId = entry?.id || null; - const changed = this._replyId !== newId; + const changed = this._replyVM?.internalId !== entry?.asEventKey().toString(); if (changed) { - this._replyId = newId; if (this._replyVM) { this.untrack(this._replyVM); this._replyVM.dispose();