max post chars and profile fields

This commit is contained in:
Dalite 2023-11-09 21:45:08 +01:00
parent f3309786f8
commit bcbdfc19fd
3 changed files with 5 additions and 5 deletions

View file

@ -104,7 +104,7 @@ class ComposeForm extends ImmutablePureComponent {
const fulltext = this.getFulltextForCharacterCounting();
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 1000 || (isOnlyWhitespace && !anyMedia));
};
handleSubmit = (e) => {
@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent {
</div>
<div className='character-counter__wrapper'>
<CharacterCounter max={500} text={this.getFulltextForCharacterCounting()} />
<CharacterCounter max={1000} text={this.getFulltextForCharacterCounting()} />
</div>
</div>
</div>

View file

@ -101,7 +101,7 @@ class Account < ApplicationRecord
validates_with UnreservedUsernameValidator, if: -> { local? && will_save_change_to_username? && actor_type != 'Application' }
validates :display_name, length: { maximum: 30 }, if: -> { local? && will_save_change_to_display_name? }
validates :note, note_length: { maximum: 500 }, if: -> { local? && will_save_change_to_note? }
validates :fields, length: { maximum: 4 }, if: -> { local? && will_save_change_to_fields? }
validates :fields, length: { maximum: 8 }, if: -> { local? && will_save_change_to_fields? }
validates :uri, absence: true, if: :local?, on: :create
validates :inbox_url, absence: true, if: :local?, on: :create
validates :shared_inbox_url, absence: true, if: :local?, on: :create
@ -344,7 +344,7 @@ class Account < ApplicationRecord
self[:fields] = fields
end
DEFAULT_FIELDS_SIZE = 4
DEFAULT_FIELDS_SIZE = 8
def build_fields
return if fields.size >= DEFAULT_FIELDS_SIZE

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
class StatusLengthValidator < ActiveModel::Validator
MAX_CHARS = 500
MAX_CHARS = 1000
URL_PLACEHOLDER_CHARS = 23
URL_PLACEHOLDER = 'x' * 23