sforkowany z mirror/soapbox
Merge branch 'use-description-limit' into 'develop'
Use media description limits from Pleroma See merge request soapbox-pub/soapbox-fe!631groups
commit
62de87363a
|
@ -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}
|
||||
|
|
|
@ -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 => ({
|
||||
|
|
|
@ -5,6 +5,7 @@ describe('instance reducer', () => {
|
|||
it('should return the initial state', () => {
|
||||
expect(reducer(undefined, {})).toEqual(ImmutableMap({
|
||||
max_toot_chars: 500,
|
||||
description_limit: 1500,
|
||||
poll_limits: ImmutableMap({
|
||||
max_expiration: 2629746,
|
||||
max_option_chars: 25,
|
||||
|
|
|
@ -26,6 +26,7 @@ const nodeinfoToInstance = nodeinfo => {
|
|||
// Set Mastodon defaults, overridden by Pleroma servers
|
||||
const initialState = ImmutableMap({
|
||||
max_toot_chars: 500,
|
||||
description_limit: 1500,
|
||||
poll_limits: ImmutableMap({
|
||||
max_expiration: 2629746,
|
||||
max_option_chars: 25,
|
||||
|
|
Ładowanie…
Reference in New Issue