From 54ffb1cbe20a114bdb3ced78a1ae6554fbd49dc9 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 4 Aug 2021 14:39:38 -0700 Subject: [PATCH] Properly emit change in reply tile --- src/domain/session/room/ComposerViewModel.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/domain/session/room/ComposerViewModel.js b/src/domain/session/room/ComposerViewModel.js index c833f101..68979128 100644 --- a/src/domain/session/room/ComposerViewModel.js +++ b/src/domain/session/room/ComposerViewModel.js @@ -49,16 +49,16 @@ export class ComposerViewModel extends ViewModel { } _updateReplyEntry(entry) { - const update = this._replyVM.updateEntry(entry); - if (update.shouldReplace) { + const action = this._replyVM.updateEntry(entry); + if (action.shouldReplace) { const newTile = this._roomVM._createTile(entry); this._replyVM.dispose(); this._replyVM = newTile || null; - } else if (update.shouldRemove) { + } else if (action.shouldRemove) { this._replyVM.dispose(); this._replyVM = null; - } else if (update.shouldUpdate) { - // Nothing, since we'll be calling emitChange anyway. + } else if (action.shouldUpdate) { + this._replyVM.emitChange(action.updateParams); } }