Fix max_toot_chars

stable/1.0.x
Alex Gleason 2020-03-30 16:47:22 -05:00
rodzic d5ca8444bb
commit 1107aa027d
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 5 dodań i 5 usunięć

Wyświetl plik

@ -21,9 +21,8 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
import { length } from 'stringz';
import { countableText } from '../util/counter';
import Icon from 'gabsocial/components/icon';
import initialState from '../../../initial_state';
import { maxTootChars } from '../../../initial_state';
const maxChars = initialState.max_toot_chars;
const allowedAroundShortCode = '><\u0085\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\u0009\u000a\u000b\u000c\u000d';
const messages = defineMessages({
@ -117,7 +116,7 @@ class ComposeForm extends ImmutablePureComponent {
const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props;
const fulltext = [this.props.spoilerText, countableText(this.props.text)].join('');
if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxTootChars || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
return;
}
@ -204,7 +203,7 @@ class ComposeForm extends ImmutablePureComponent {
const condensed = shouldCondense && !this.props.text && !this.state.composeFocused;
const disabled = this.props.isSubmitting;
const text = [this.props.spoilerText, countableText(this.props.text)].join('');
const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > maxChars || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > maxTootChars || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
const shouldAutoFocus = autoFocus && !showSearch && !isMobile(window.innerWidth)
let publishText = '';
@ -281,7 +280,7 @@ class ComposeForm extends ImmutablePureComponent {
<PrivacyDropdownContainer />
<SpoilerButtonContainer />
</div>
<div className='character-counter__wrapper'><CharacterCounter max={maxChars} text={text} /></div>
<div className='character-counter__wrapper'><CharacterCounter max={maxTootChars} text={text} /></div>
</div>
}

Wyświetl plik

@ -28,5 +28,6 @@ export const forceSingleColumn = !getMeta('advanced_layout');
export const funding = getMeta('funding');
export const promoItems = getMeta('promo_items');
export const unreadCount = getMeta('unread_count');
export const maxTootChars = getMeta('max_toot_chars');
export default initialState;