Ensure DM rooms have the same color in timeline and left panel.
This commit is contained in:
parent
ce647e78ce
commit
97854423c4
4 changed files with 15 additions and 2 deletions
|
@ -34,7 +34,7 @@ export class RoomDetailsViewModel extends ViewModel {
|
|||
}
|
||||
|
||||
get avatarColorNumber() {
|
||||
return getIdentifierColorNumber(this.roomId)
|
||||
return getIdentifierColorNumber(this._room.avatarColorId)
|
||||
}
|
||||
|
||||
avatarUrl(size) {
|
||||
|
|
|
@ -119,7 +119,7 @@ export class RoomViewModel extends ViewModel {
|
|||
}
|
||||
|
||||
get avatarColorNumber() {
|
||||
return getIdentifierColorNumber(this._room.id)
|
||||
return getIdentifierColorNumber(this._room.avatarColorId)
|
||||
}
|
||||
|
||||
avatarUrl(size) {
|
||||
|
|
|
@ -328,6 +328,10 @@ export class Room extends BaseRoom {
|
|||
});
|
||||
}
|
||||
|
||||
get avatarColorId() {
|
||||
return this._heroes?.roomAvatarColorId || this._roomId
|
||||
}
|
||||
|
||||
get isUnread() {
|
||||
return this._summary.data.isUnread;
|
||||
}
|
||||
|
|
|
@ -97,4 +97,13 @@ export class Heroes {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
get roomAvatarColorId() {
|
||||
if (this._members.size === 1) {
|
||||
for (const member of this._members.values()) {
|
||||
return member.userId;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue