don't even need isOwn member anymore

This commit is contained in:
Bruno Windels 2021-05-31 15:25:01 +02:00
parent 00231443d3
commit 8196a02f9d
2 changed files with 7 additions and 4 deletions

View File

@ -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() {

View File

@ -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;
} }
} }