]> cat aescling's git repositories - mastodon.git/commitdiff
Change max length of media descriptions from 420 to 1500 characters (#11819)
authorEugen Rochko <eugen@zeonfederated.com>
Fri, 13 Sep 2019 14:00:34 +0000 (16:00 +0200)
committerGitHub <noreply@github.com>
Fri, 13 Sep 2019 14:00:34 +0000 (16:00 +0200)
Fix #11658

app/javascript/mastodon/features/ui/components/focal_point_modal.js
app/models/media_attachment.rb

index 735e445e88cc3a96d439ce4c834e8e919c130ff5..d13138a76b062ac5371eb6a94738fc65f9c2c415 100644 (file)
@@ -223,7 +223,7 @@ class FocalPointModal extends ImmutablePureComponent {
 
             <div className='setting-text__toolbar'>
               <button disabled={detecting || media.get('type') !== 'image'} className='link-button' onClick={this.handleTextDetection}><FormattedMessage id='upload_modal.detect_text' defaultMessage='Detect text from picture' /></button>
-              <CharacterCounter max={420} text={detecting ? '' : description} />
+              <CharacterCounter max={1500} text={detecting ? '' : description} />
             </div>
 
             <Button disabled={!dirty || detecting || length(description) > 420} text={intl.formatMessage(messages.apply)} onClick={this.handleSubmit} />
index a2b73f1508d15d91e82c46fdf64a0ae3ec450773..c4932f2ef5923e91368acb7517137ce9de56d119 100644 (file)
@@ -123,7 +123,7 @@ class MediaAttachment < ApplicationRecord
   include Attachmentable
 
   validates :account, presence: true
-  validates :description, length: { maximum: 420 }, if: :local?
+  validates :description, length: { maximum: 1_500 }, if: :local?
 
   scope :attached,   -> { where.not(status_id: nil).or(where.not(scheduled_status_id: nil)) }
   scope :unattached, -> { where(status_id: nil, scheduled_status_id: nil) }