mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-18 04:39:04 +01:00
[Glitch] Fix media modal crashing when media has no blurhash
Port 13206fcfb8
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
9dde2400d0
commit
cccc65651d
1 changed files with 5 additions and 2 deletions
|
@ -231,9 +231,12 @@ class MediaModal extends ImmutablePureComponent {
|
|||
_sendBackgroundColor () {
|
||||
const { media, onChangeBackgroundColor } = this.props;
|
||||
const index = this.getIndex();
|
||||
const backgroundColor = decodeRGB(decode83(media.getIn([index, 'blurhash']).slice(2, 6)));
|
||||
const blurhash = media.getIn([index, 'blurhash']);
|
||||
|
||||
onChangeBackgroundColor(backgroundColor);
|
||||
if (blurhash) {
|
||||
const backgroundColor = decodeRGB(decode83(blurhash.slice(2, 6)));
|
||||
onChangeBackgroundColor(backgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
render () {
|
||||
|
|
Loading…
Reference in a new issue