mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-15 00:01:31 +03:00
Don't store blurhash in state, its immutable and pointless
This commit is contained in:
parent
ba7604fd44
commit
563e6433b9
1 changed files with 3 additions and 4 deletions
|
@ -60,7 +60,6 @@ export default class MImageBody extends React.Component {
|
||||||
this.onClick = this.onClick.bind(this);
|
this.onClick = this.onClick.bind(this);
|
||||||
this._isGif = this._isGif.bind(this);
|
this._isGif = this._isGif.bind(this);
|
||||||
|
|
||||||
const imageInfo = this.props.mxEvent.getContent().info;
|
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
decryptedUrl: null,
|
decryptedUrl: null,
|
||||||
|
@ -72,7 +71,6 @@ export default class MImageBody extends React.Component {
|
||||||
loadedImageDimensions: null,
|
loadedImageDimensions: null,
|
||||||
hover: false,
|
hover: false,
|
||||||
showImage: SettingsStore.getValue("showImages"),
|
showImage: SettingsStore.getValue("showImages"),
|
||||||
blurhash: imageInfo ? imageInfo['xyz.amorgan.blurhash'] : null, // TODO: Use `blurhash` when MSC2448 lands.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this._image = createRef();
|
this._image = createRef();
|
||||||
|
@ -442,8 +440,9 @@ export default class MImageBody extends React.Component {
|
||||||
|
|
||||||
// Overidden by MStickerBody
|
// Overidden by MStickerBody
|
||||||
getPlaceholder(width, height) {
|
getPlaceholder(width, height) {
|
||||||
if (!this.state.blurhash) return null;
|
const blurhash = this.props.mxEvent.getContent().info['xyz.amorgan.blurhash'];
|
||||||
return <BlurhashPlaceholder blurhash={this.state.blurhash} width={width} height={height} />;
|
if (!blurhash) return null;
|
||||||
|
return <BlurhashPlaceholder blurhash={blurhash} width={width} height={height} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overidden by MStickerBody
|
// Overidden by MStickerBody
|
||||||
|
|
Loading…
Reference in a new issue