Ensure link rewriting setting changes are immediately applied

main
Thibaut Girka 2019-08-01 15:20:22 +02:00 committed by ThibG
parent 6600da0f7b
commit c01de0f721
1 changed files with 4 additions and 1 deletions

View File

@ -280,6 +280,7 @@ export default class StatusContent extends React.PureComponent {
mediaIcon, mediaIcon,
parseClick, parseClick,
disabled, disabled,
linkRewriting,
} = this.props; } = this.props;
const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden; const hidden = this.props.onExpandedToggle ? !this.props.expanded : this.state.hidden;
@ -354,6 +355,7 @@ export default class StatusContent extends React.PureComponent {
<div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}> <div className={`status__content__spoiler ${!hidden ? 'status__content__spoiler--visible' : ''}`}>
<div <div
ref={this.setContentsRef} ref={this.setContentsRef}
key={`contents-${linkRewriting}`}
style={directionStyle} style={directionStyle}
tabIndex={!hidden ? 0 : null} tabIndex={!hidden ? 0 : null}
dangerouslySetInnerHTML={content} dangerouslySetInnerHTML={content}
@ -377,6 +379,7 @@ export default class StatusContent extends React.PureComponent {
> >
<div <div
ref={this.setContentsRef} ref={this.setContentsRef}
key={`contents-${linkRewriting}`}
dangerouslySetInnerHTML={content} dangerouslySetInnerHTML={content}
lang={status.get('language')} lang={status.get('language')}
className='status__content__text' className='status__content__text'
@ -393,7 +396,7 @@ export default class StatusContent extends React.PureComponent {
tabIndex='0' tabIndex='0'
ref={this.setRef} ref={this.setRef}
> >
<div ref={this.setContentsRef} className='status__content__text' dangerouslySetInnerHTML={content} lang={status.get('language')} tabIndex='0' /> <div ref={this.setContentsRef} key={`contents-${linkRewriting}`} className='status__content__text' dangerouslySetInnerHTML={content} lang={status.get('language')} tabIndex='0' />
{media} {media}
</div> </div>
); );