use const for blurhash field
This commit is contained in:
parent
254697644e
commit
dbca9b4625
2 changed files with 3 additions and 2 deletions
|
@ -49,7 +49,7 @@ const MAX_HEIGHT = 600;
|
||||||
// 5669 px (x-axis) , 5669 px (y-axis) , per metre
|
// 5669 px (x-axis) , 5669 px (y-axis) , per metre
|
||||||
const PHYS_HIDPI = [0x00, 0x00, 0x16, 0x25, 0x00, 0x00, 0x16, 0x25, 0x01];
|
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_X_COMPONENTS = 6;
|
||||||
const BLURHASH_Y_COMPONENTS = 6;
|
const BLURHASH_Y_COMPONENTS = 6;
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ import InlineSpinner from '../elements/InlineSpinner';
|
||||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||||
import {mediaFromContent} from "../../../customisations/Media";
|
import {mediaFromContent} from "../../../customisations/Media";
|
||||||
import BlurhashPlaceholder from "../elements/BlurhashPlaceholder";
|
import BlurhashPlaceholder from "../elements/BlurhashPlaceholder";
|
||||||
|
import {BLURHASH_FIELD} from "../../../ContentMessages";
|
||||||
|
|
||||||
@replaceableComponent("views.messages.MImageBody")
|
@replaceableComponent("views.messages.MImageBody")
|
||||||
export default class MImageBody extends React.Component {
|
export default class MImageBody extends React.Component {
|
||||||
|
@ -440,7 +441,7 @@ export default class MImageBody extends React.Component {
|
||||||
|
|
||||||
// Overidden by MStickerBody
|
// Overidden by MStickerBody
|
||||||
getPlaceholder(width, height) {
|
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;
|
if (!blurhash) return null;
|
||||||
return <BlurhashPlaceholder blurhash={blurhash} width={width} height={height} />;
|
return <BlurhashPlaceholder blurhash={blurhash} width={width} height={height} />;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue