Merge branch 'develop' into dbkr/jitsi_display_name
This commit is contained in:
commit
d95955d90b
75 changed files with 989 additions and 540 deletions
|
@ -22,6 +22,7 @@ import { User } from "matrix-js-sdk/src/models/user";
|
|||
import { throttle } from "lodash";
|
||||
import { MatrixClientPeg } from "../MatrixClientPeg";
|
||||
import { _t } from "../languageHandler";
|
||||
import {mediaFromMxc} from "../customisations/Media";
|
||||
|
||||
interface IState {
|
||||
displayName?: string;
|
||||
|
@ -81,12 +82,13 @@ export class OwnProfileStore extends AsyncStoreWithClient<IState> {
|
|||
*/
|
||||
public getHttpAvatarUrl(size = 0): string {
|
||||
if (!this.avatarMxc) return null;
|
||||
const adjustedSize = size > 1 ? size : undefined; // don't let negatives or zero through
|
||||
|
||||
// XXX: We use MatrixClientPeg here rather than this.matrixClient because otherwise we'll
|
||||
// race because our data stores aren't set up consistently enough that this will all be
|
||||
// initialised with a store before these getter methods are called.
|
||||
return MatrixClientPeg.get().mxcUrlToHttp(this.avatarMxc, adjustedSize, adjustedSize);
|
||||
const media = mediaFromMxc(this.avatarMxc);
|
||||
if (!size || size <= 0) {
|
||||
return media.srcHttp;
|
||||
} else {
|
||||
return media.getSquareThumbnailHttp(size);
|
||||
}
|
||||
}
|
||||
|
||||
protected async onNotReady() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue