don't cache DRP
This commit is contained in:
parent
7c03d71607
commit
a75c948e2e
1 changed files with 2 additions and 4 deletions
|
@ -18,8 +18,6 @@ import AutocompleteWrapperModel from "./autocomplete";
|
||||||
import Avatar from "../Avatar";
|
import Avatar from "../Avatar";
|
||||||
import MatrixClientPeg from "../MatrixClientPeg";
|
import MatrixClientPeg from "../MatrixClientPeg";
|
||||||
|
|
||||||
const DPR = window.devicePixelRatio;
|
|
||||||
|
|
||||||
class BasePart {
|
class BasePart {
|
||||||
constructor(text = "") {
|
constructor(text = "") {
|
||||||
this._text = text;
|
this._text = text;
|
||||||
|
@ -252,7 +250,7 @@ export class RoomPillPart extends PillPart {
|
||||||
|
|
||||||
setAvatar(node) {
|
setAvatar(node) {
|
||||||
let initialLetter = "";
|
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) {
|
if (!avatarUrl) {
|
||||||
initialLetter = Avatar.getInitialLetter(this._room.name);
|
initialLetter = Avatar.getInitialLetter(this._room.name);
|
||||||
avatarUrl = `../../${Avatar.defaultAvatarUrlForString(this._room.roomId)}`;
|
avatarUrl = `../../${Avatar.defaultAvatarUrlForString(this._room.roomId)}`;
|
||||||
|
@ -278,7 +276,7 @@ export class UserPillPart extends PillPart {
|
||||||
setAvatar(node) {
|
setAvatar(node) {
|
||||||
const name = this._member.name || this._member.userId;
|
const name = this._member.name || this._member.userId;
|
||||||
const defaultAvatarUrl = Avatar.defaultAvatarUrlForString(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 = "";
|
let initialLetter = "";
|
||||||
if (avatarUrl === defaultAvatarUrl) {
|
if (avatarUrl === defaultAvatarUrl) {
|
||||||
// the url from defaultAvatarUrlForString is meant to go in an img element,
|
// the url from defaultAvatarUrlForString is meant to go in an img element,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue