[Glitch] Fix audio modals not using blurhash and poster
Port 162adf61f2 to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
			
			
This commit is contained in:
		
				
					committed by
					
						
						Thibaut Girka
					
				
			
			
				
	
			
			
			
						parent
						
							2d8be0a6e1
						
					
				
				
					commit
					ad73e05f46
				
			@@ -36,8 +36,9 @@ export default class AudioModal extends ImmutablePureComponent {
 | 
				
			|||||||
            src={media.get('url')}
 | 
					            src={media.get('url')}
 | 
				
			||||||
            alt={media.get('description')}
 | 
					            alt={media.get('description')}
 | 
				
			||||||
            duration={media.getIn(['meta', 'original', 'duration'], 0)}
 | 
					            duration={media.getIn(['meta', 'original', 'duration'], 0)}
 | 
				
			||||||
            height={135}
 | 
					            height={150}
 | 
				
			||||||
            preload
 | 
					            poster={media.get('preview_url') || status.getIn(['account', 'avatar_static'])}
 | 
				
			||||||
 | 
					            blurhash={media.get('blurhash')}
 | 
				
			||||||
          />
 | 
					          />
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,7 @@ import CharacterCounter from 'flavours/glitch/features/compose/components/charac
 | 
				
			|||||||
import { length } from 'stringz';
 | 
					import { length } from 'stringz';
 | 
				
			||||||
import { Tesseract as fetchTesseract } from 'flavours/glitch/util/async-components';
 | 
					import { Tesseract as fetchTesseract } from 'flavours/glitch/util/async-components';
 | 
				
			||||||
import GIFV from 'flavours/glitch/components/gifv';
 | 
					import GIFV from 'flavours/glitch/components/gifv';
 | 
				
			||||||
 | 
					import { me } from 'flavours/glitch/util/initial_state';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const messages = defineMessages({
 | 
					const messages = defineMessages({
 | 
				
			||||||
  close: { id: 'lightbox.close', defaultMessage: 'Close' },
 | 
					  close: { id: 'lightbox.close', defaultMessage: 'Close' },
 | 
				
			||||||
@@ -26,6 +27,7 @@ const messages = defineMessages({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const mapStateToProps = (state, { id }) => ({
 | 
					const mapStateToProps = (state, { id }) => ({
 | 
				
			||||||
  media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),
 | 
					  media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),
 | 
				
			||||||
 | 
					  account: state.getIn(['accounts', me]),
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const mapDispatchToProps = (dispatch, { id }) => ({
 | 
					const mapDispatchToProps = (dispatch, { id }) => ({
 | 
				
			||||||
@@ -78,6 +80,7 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  static propTypes = {
 | 
					  static propTypes = {
 | 
				
			||||||
    media: ImmutablePropTypes.map.isRequired,
 | 
					    media: ImmutablePropTypes.map.isRequired,
 | 
				
			||||||
 | 
					    account: ImmutablePropTypes.map.isRequired,
 | 
				
			||||||
    onClose: PropTypes.func.isRequired,
 | 
					    onClose: PropTypes.func.isRequired,
 | 
				
			||||||
    intl: PropTypes.object.isRequired,
 | 
					    intl: PropTypes.object.isRequired,
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
@@ -233,7 +236,7 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  render () {
 | 
					  render () {
 | 
				
			||||||
    const { media, intl, onClose } = this.props;
 | 
					    const { media, intl, account, onClose } = this.props;
 | 
				
			||||||
    const { x, y, dragging, description, dirty, detecting, progress } = this.state;
 | 
					    const { x, y, dragging, description, dirty, detecting, progress } = this.state;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const width  = media.getIn(['meta', 'original', 'width']) || null;
 | 
					    const width  = media.getIn(['meta', 'original', 'width']) || null;
 | 
				
			||||||
@@ -325,7 +328,8 @@ class FocalPointModal extends ImmutablePureComponent {
 | 
				
			|||||||
                src={media.get('url')}
 | 
					                src={media.get('url')}
 | 
				
			||||||
                duration={media.getIn(['meta', 'original', 'duration'], 0)}
 | 
					                duration={media.getIn(['meta', 'original', 'duration'], 0)}
 | 
				
			||||||
                height={150}
 | 
					                height={150}
 | 
				
			||||||
                preload
 | 
					                poster={media.get('preview_url') || account.get('avatar_static')}
 | 
				
			||||||
 | 
					                blurhash={media.get('blurhash')}
 | 
				
			||||||
                editable
 | 
					                editable
 | 
				
			||||||
              />
 | 
					              />
 | 
				
			||||||
            )}
 | 
					            )}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user