Add JSDoc to new Hero method

This commit is contained in:
Danila Fedorin 2021-06-30 15:15:08 -07:00
parent ee1f1500e9
commit b40f946b85

View file

@ -98,6 +98,14 @@ export class Heroes {
return null; return null;
} }
/**
* In DM rooms, we want the room's color to be
* the same as the other user's color. Thus, if the room
* only has one hero, we use their ID, instead
* of the room's, to get the avatar color.
*
* @returns {?string} the ID of the single hero.
*/
get roomAvatarColorId() { get roomAvatarColorId() {
if (this._members.size === 1) { if (this._members.size === 1) {
for (const member of this._members.keys()) { for (const member of this._members.keys()) {