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._date = this._entry.timestamp ? new Date(this._entry.timestamp) : null;
|
||||||
this._isContinuation = false;
|
this._isContinuation = false;
|
||||||
this._reactions = null;
|
this._reactions = null;
|
||||||
this._replyTextTile = null;
|
this._replyTile = null;
|
||||||
if (this._entry.annotations || this._entry.pendingAnnotations) {
|
if (this._entry.annotations || this._entry.pendingAnnotations) {
|
||||||
this._updateReactions();
|
this._updateReactions();
|
||||||
}
|
}
|
||||||
@ -216,16 +216,16 @@ export class BaseMessageTile extends SimpleTile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get replyTextTile() {
|
get replyTile() {
|
||||||
if (!this._entry.contextEventId) {
|
if (!this._entry.contextEventId) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!this._replyTextTile) {
|
if (!this._replyTile) {
|
||||||
const entry = this._entry.contextEntry;
|
const entry = this._entry.contextEntry;
|
||||||
if (entry) {
|
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;
|
const replyEntry = param?.reply ?? entry.contextEntry;
|
||||||
if (replyEntry) {
|
if (replyEntry) {
|
||||||
// this is an update to contextEntry used for replyPreview
|
// this is an update to contextEntry used for replyPreview
|
||||||
const action = this._replyTextTile?.updateEntry(replyEntry);
|
const action = this._replyTile?.updateEntry(replyEntry);
|
||||||
if (action?.shouldReplace) {
|
if (action?.shouldReplace) {
|
||||||
this._replyTextTile = this._tileCreator(replyEntry);
|
this._replyTile = this._tileCreator(replyEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const renderedAsRedacted = this.shape === "redacted";
|
const renderedAsRedacted = this.shape === "redacted";
|
||||||
|
@ -26,13 +26,13 @@ export class TextMessageView extends BaseMessageView {
|
|||||||
"Timeline_messageBody": true,
|
"Timeline_messageBody": true,
|
||||||
statusMessage: vm => vm.shape === "message-status",
|
statusMessage: vm => vm.shape === "message-status",
|
||||||
}
|
}
|
||||||
}, t.mapView(vm => vm.replyTextTile, replyTextTile => {
|
}, t.mapView(vm => vm.replyTile, replyTile => {
|
||||||
if (vm.isReply && !replyTextTile) {
|
if (vm.isReply && !replyTile) {
|
||||||
return new ReplyPreviewError();
|
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.
|
// 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 {
|
else {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user