mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
don't even need isOwn member anymore
This commit is contained in:
parent
00231443d3
commit
8196a02f9d
@ -20,7 +20,6 @@ import {getIdentifierColorNumber, avatarInitials, getAvatarHttpUrl} from "../../
|
|||||||
export class BaseMessageTile extends SimpleTile {
|
export class BaseMessageTile extends SimpleTile {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
super(options);
|
super(options);
|
||||||
this._isOwn = this._entry.sender === options.timeline.me.userId;
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
@ -67,7 +66,7 @@ export class BaseMessageTile extends SimpleTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get isOwn() {
|
get isOwn() {
|
||||||
return this._isOwn;
|
return this._entry.sender === this._ownMember.userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
get isContinuation() {
|
get isContinuation() {
|
||||||
|
@ -121,10 +121,14 @@ export class SimpleTile extends ViewModel {
|
|||||||
// TilesCollection contract above
|
// TilesCollection contract above
|
||||||
|
|
||||||
get _room() {
|
get _room() {
|
||||||
return this.getOption("room");
|
return this._options.room;
|
||||||
}
|
}
|
||||||
|
|
||||||
get _powerLevels() {
|
get _powerLevels() {
|
||||||
return this.getOption("timeline").powerLevels;
|
return this._options.timeline.powerLevels;
|
||||||
|
}
|
||||||
|
|
||||||
|
get _ownMember() {
|
||||||
|
return this._options.timeline.me;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user