use const for blurhash field

pull/21833/head
Michael Telatynski 2021-05-21 21:19:41 +01:00
parent 254697644e
commit dbca9b4625
2 changed files with 3 additions and 2 deletions

View File

@ -49,7 +49,7 @@ const MAX_HEIGHT = 600;
// 5669 px (x-axis) , 5669 px (y-axis) , per metre
const PHYS_HIDPI = [0x00, 0x00, 0x16, 0x25, 0x00, 0x00, 0x16, 0x25, 0x01];
const BLURHASH_FIELD = "xyz.amorgan.blurhash"; // MSC2448
export const BLURHASH_FIELD = "xyz.amorgan.blurhash"; // MSC2448
const BLURHASH_X_COMPONENTS = 6;
const BLURHASH_Y_COMPONENTS = 6;

View File

@ -30,6 +30,7 @@ import InlineSpinner from '../elements/InlineSpinner';
import {replaceableComponent} from "../../../utils/replaceableComponent";
import {mediaFromContent} from "../../../customisations/Media";
import BlurhashPlaceholder from "../elements/BlurhashPlaceholder";
import {BLURHASH_FIELD} from "../../../ContentMessages";
@replaceableComponent("views.messages.MImageBody")
export default class MImageBody extends React.Component {
@ -440,7 +441,7 @@ export default class MImageBody extends React.Component {
// Overidden by MStickerBody
getPlaceholder(width, height) {
const blurhash = this.props.mxEvent.getContent().info['xyz.amorgan.blurhash'];
const blurhash = this.props.mxEvent.getContent().info[BLURHASH_FIELD];
if (!blurhash) return null;
return <BlurhashPlaceholder blurhash={blurhash} width={width} height={height} />;
}