mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Ensure DM rooms have the same color in timeline and left panel.
This commit is contained in:
parent
ce647e78ce
commit
97854423c4
@ -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) {
|
||||||
|
@ -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) {
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user