don't cache DRP
parent
7c03d71607
commit
a75c948e2e
|
@ -18,8 +18,6 @@ import AutocompleteWrapperModel from "./autocomplete";
|
|||
import Avatar from "../Avatar";
|
||||
import MatrixClientPeg from "../MatrixClientPeg";
|
||||
|
||||
const DPR = window.devicePixelRatio;
|
||||
|
||||
class BasePart {
|
||||
constructor(text = "") {
|
||||
this._text = text;
|
||||
|
@ -252,7 +250,7 @@ export class RoomPillPart extends PillPart {
|
|||
|
||||
setAvatar(node) {
|
||||
let initialLetter = "";
|
||||
let avatarUrl = Avatar.avatarUrlForRoom(this._room, 16 * DPR, 16 * DPR);
|
||||
let avatarUrl = Avatar.avatarUrlForRoom(this._room, 16 * window.devicePixelRatio, 16 * window.devicePixelRatio);
|
||||
if (!avatarUrl) {
|
||||
initialLetter = Avatar.getInitialLetter(this._room.name);
|
||||
avatarUrl = `../../${Avatar.defaultAvatarUrlForString(this._room.roomId)}`;
|
||||
|
@ -278,7 +276,7 @@ export class UserPillPart extends PillPart {
|
|||
setAvatar(node) {
|
||||
const name = this._member.name || this._member.userId;
|
||||
const defaultAvatarUrl = Avatar.defaultAvatarUrlForString(this._member.userId);
|
||||
let avatarUrl = Avatar.avatarUrlForMember(this._member, 16 * DPR, 16 * DPR);
|
||||
let avatarUrl = Avatar.avatarUrlForMember(this._member, 16 * window.devicePixelRatio, 16 * window.devicePixelRatio);
|
||||
let initialLetter = "";
|
||||
if (avatarUrl === defaultAvatarUrl) {
|
||||
// the url from defaultAvatarUrlForString is meant to go in an img element,
|
||||
|
|
Loading…
Reference in New Issue