Use description limits from Pleroma

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2021-07-19 23:14:31 +02:00
parent 567c4ce093
commit bedc9ef3fa
2 changed files with 3 additions and 2 deletions

View file

@ -92,7 +92,7 @@ class Upload extends ImmutablePureComponent {
}
render() {
const { intl, media } = this.props;
const { intl, media, descriptionLimit } = this.props;
const active = this.state.hovered || this.state.focused;
const description = this.state.dirtyDescription || (this.state.dirtyDescription !== '' && media.get('description')) || '';
const focusX = media.getIn(['meta', 'focus', 'x']);
@ -125,7 +125,7 @@ class Upload extends ImmutablePureComponent {
<textarea
placeholder={intl.formatMessage(messages.description)}
value={description}
maxLength={420}
maxLength={descriptionLimit}
onFocus={this.handleInputFocus}
onChange={this.handleInputChange}
onBlur={this.handleInputBlur}

View file

@ -7,6 +7,7 @@ import { List as ImmutableList } from 'immutable';
const mapStateToProps = (state, { id }) => ({
media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),
descriptionLimit: state.getIn(['instance', 'description_limit']),
});
const mapDispatchToProps = dispatch => ({