Ensure DM rooms have the same color in timeline and left panel.

This commit is contained in:
Danila Fedorin 2021-06-28 11:44:27 -07:00
parent ce647e78ce
commit 97854423c4
4 changed files with 15 additions and 2 deletions

View File

@ -34,7 +34,7 @@ export class RoomDetailsViewModel extends ViewModel {
} }
get avatarColorNumber() { get avatarColorNumber() {
return getIdentifierColorNumber(this.roomId) return getIdentifierColorNumber(this._room.avatarColorId)
} }
avatarUrl(size) { avatarUrl(size) {

View File

@ -119,7 +119,7 @@ export class RoomViewModel extends ViewModel {
} }
get avatarColorNumber() { get avatarColorNumber() {
return getIdentifierColorNumber(this._room.id) return getIdentifierColorNumber(this._room.avatarColorId)
} }
avatarUrl(size) { avatarUrl(size) {

View File

@ -328,6 +328,10 @@ export class Room extends BaseRoom {
}); });
} }
get avatarColorId() {
return this._heroes?.roomAvatarColorId || this._roomId
}
get isUnread() { get isUnread() {
return this._summary.data.isUnread; return this._summary.data.isUnread;
} }

View File

@ -97,4 +97,13 @@ export class Heroes {
} }
return null; return null;
} }
get roomAvatarColorId() {
if (this._members.size === 1) {
for (const member of this._members.values()) {
return member.userId;
}
}
return null;
}
} }