|
|
@ -221,10 +221,13 @@ class MediaModal extends ImmutablePureComponent { |
|
|
|
_sendBackgroundColor () { |
|
|
|
_sendBackgroundColor () { |
|
|
|
const { media, onChangeBackgroundColor } = this.props; |
|
|
|
const { media, onChangeBackgroundColor } = this.props; |
|
|
|
const index = this.getIndex(); |
|
|
|
const index = this.getIndex(); |
|
|
|
const backgroundColor = decodeRGB(decode83(media.getIn([index, 'blurhash']).slice(2, 6))); |
|
|
|
const blurhash = media.getIn([index, 'blurhash']); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (blurhash) { |
|
|
|
|
|
|
|
const backgroundColor = decodeRGB(decode83(blurhash.slice(2, 6))); |
|
|
|
onChangeBackgroundColor(backgroundColor); |
|
|
|
onChangeBackgroundColor(backgroundColor); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
componentWillUnmount () { |
|
|
|
componentWillUnmount () { |
|
|
|
window.removeEventListener('keydown', this.handleKeyDown); |
|
|
|
window.removeEventListener('keydown', this.handleKeyDown); |
|
|
|