don't cache DRP

pull/21833/head
Bruno Windels 2019-05-21 12:24:12 +02:00
parent 7c03d71607
commit a75c948e2e
1 changed files with 2 additions and 4 deletions

View File

@ -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,