mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Rename replyTextTile -> replyTile
This commit is contained in:
parent
086e0c0320
commit
7f91653208
@ -24,7 +24,7 @@ export class BaseMessageTile extends SimpleTile {
|
||||
this._date = this._entry.timestamp ? new Date(this._entry.timestamp) : null;
|
||||
this._isContinuation = false;
|
||||
this._reactions = null;
|
||||
this._replyTextTile = null;
|
||||
this._replyTile = null;
|
||||
if (this._entry.annotations || this._entry.pendingAnnotations) {
|
||||
this._updateReactions();
|
||||
}
|
||||
@ -216,16 +216,16 @@ export class BaseMessageTile extends SimpleTile {
|
||||
}
|
||||
}
|
||||
|
||||
get replyTextTile() {
|
||||
get replyTile() {
|
||||
if (!this._entry.contextEventId) {
|
||||
return null;
|
||||
}
|
||||
if (!this._replyTextTile) {
|
||||
if (!this._replyTile) {
|
||||
const entry = this._entry.contextEntry;
|
||||
if (entry) {
|
||||
this._replyTextTile = this._tileCreator(entry);
|
||||
this._replyTile = this._tileCreator(entry);
|
||||
}
|
||||
}
|
||||
return this._replyTextTile;
|
||||
return this._replyTile;
|
||||
}
|
||||
}
|
||||
|
@ -97,9 +97,9 @@ export class SimpleTile extends ViewModel {
|
||||
const replyEntry = param?.reply ?? entry.contextEntry;
|
||||
if (replyEntry) {
|
||||
// this is an update to contextEntry used for replyPreview
|
||||
const action = this._replyTextTile?.updateEntry(replyEntry);
|
||||
const action = this._replyTile?.updateEntry(replyEntry);
|
||||
if (action?.shouldReplace) {
|
||||
this._replyTextTile = this._tileCreator(replyEntry);
|
||||
this._replyTile = this._tileCreator(replyEntry);
|
||||
}
|
||||
}
|
||||
const renderedAsRedacted = this.shape === "redacted";
|
||||
|
@ -26,13 +26,13 @@ export class TextMessageView extends BaseMessageView {
|
||||
"Timeline_messageBody": true,
|
||||
statusMessage: vm => vm.shape === "message-status",
|
||||
}
|
||||
}, t.mapView(vm => vm.replyTextTile, replyTextTile => {
|
||||
if (vm.isReply && !replyTextTile) {
|
||||
}, t.mapView(vm => vm.replyTile, replyTile => {
|
||||
if (vm.isReply && !replyTile) {
|
||||
return new ReplyPreviewError();
|
||||
}
|
||||
else if (replyTextTile && !this._isReplyPreview) {
|
||||
else if (replyTile && !this._isReplyPreview) {
|
||||
// if this._isReplyPreview = true, this is already a reply preview, don't nest replies for now.
|
||||
return new ReplyPreviewView(replyTextTile);
|
||||
return new ReplyPreviewView(replyTile);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user