mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Split ifs and remove ?. abuse
This commit is contained in:
parent
846e637716
commit
e1b9b1161d
@ -117,15 +117,15 @@ export class BaseMessageTile extends SimpleTile {
|
|||||||
|
|
||||||
updateEntry(entry, param) {
|
updateEntry(entry, param) {
|
||||||
const replyEntry = entry.contextEntry;
|
const replyEntry = entry.contextEntry;
|
||||||
if (replyEntry) {
|
if (replyEntry && this._replyTile) {
|
||||||
// this is an update to contextEntry used for replyPreview
|
// this is an update to contextEntry used for replyPreview
|
||||||
const action = this._replyTile?.updateEntry(replyEntry);
|
const action = this._replyTile.updateEntry(replyEntry);
|
||||||
if (action?.shouldReplace) {
|
if (action?.shouldReplace) {
|
||||||
this.disposeTracked(this._replyTile);
|
this.disposeTracked(this._replyTile);
|
||||||
this._replyTile = this._tileCreator(replyEntry);
|
this._replyTile = this._tileCreator(replyEntry);
|
||||||
}
|
}
|
||||||
else {
|
if(action?.shouldUpdate) {
|
||||||
this._replyTile?.emitChange();
|
this._replyTile.emitChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const action = super.updateEntry(entry, param);
|
const action = super.updateEntry(entry, param);
|
||||||
|
Loading…
Reference in New Issue
Block a user