about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorbeatrix <beatrix.bitrot@gmail.com>2017-11-17 19:02:40 -0500
committerGitHub <noreply@github.com>2017-11-17 19:02:40 -0500
commit5a9982b425d3db65d813eb0314a27cea16f0f52d (patch)
treeeabdb52c5d75421876397720b5b79e270ea705e9 /app/javascript
parent284e2cde81811d6289dde9542f9c987062f9e7c2 (diff)
parentdc16d73bf5f3e7db54e4f21848f40cff3d9172ca (diff)
Merge pull request #223 from glitch-soc/glitchsoc/feature/configurable-status-size
Make character limit configurable (from tootsuite/mastodon#5697)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/mastodon/features/compose/components/compose_form.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js
index 13a41f23f..aaca45493 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.js
+++ b/app/javascript/mastodon/features/compose/components/compose_form.js
@@ -19,6 +19,9 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
 import { length } from 'stringz';
 import { countableText } from '../util/counter';
 import ComposeAttachOptions from '../../../../glitch/components/compose/attach_options/index';
+import initialState from '../../../initial_state';
+
+const maxChars = initialState.max_toot_chars;
 
 const messages = defineMessages({
   placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' },
@@ -205,7 +208,7 @@ export default class ComposeForm extends ImmutablePureComponent {
       }
     }
 
-    const submitDisabled = disabled || this.props.is_uploading || length(text) > 500 || (text.length !== 0 && text.trim().length === 0);
+    const submitDisabled = disabled || this.props.is_uploading || length(text) > maxChars || (text.length !== 0 && text.trim().length === 0);
 
     return (
       <div className='compose-form'>
@@ -255,7 +258,7 @@ export default class ComposeForm extends ImmutablePureComponent {
         </div>
 
         <div className='compose-form__publish'>
-          <div className='character-counter__wrapper'><CharacterCounter max={500} text={text} /></div>
+          <div className='character-counter__wrapper'><CharacterCounter max={maxChars} text={text} /></div>
           <div className='compose-form__publish-button-wrapper'>
             {
               showSideArm ?