mirror of https://github.com/vector-im/riot-web
use const for blurhash field
parent
254697644e
commit
dbca9b4625
|
@ -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;
|
||||
|
||||
|
|
|
@ -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} />;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue