Profile editing: Re-adds the character counter with the new limit (#38400)

This commit is contained in:
Echo 2026-03-25 16:31:58 +01:00 committed by GitHub
parent 2a4b205c75
commit 61e0ec8844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@ import { useCallback, useState } from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import { CharacterCounter } from '@/mastodon/components/character_counter';
import { Details } from '@/mastodon/components/details'; import { Details } from '@/mastodon/components/details';
import { TextAreaField } from '@/mastodon/components/form_fields'; import { TextAreaField } from '@/mastodon/components/form_fields';
import { LoadingIndicator } from '@/mastodon/components/loading_indicator'; import { LoadingIndicator } from '@/mastodon/components/loading_indicator';
@ -84,7 +85,12 @@ export const ImageAltTextField: FC<{
const altLimit = useAppSelector( const altLimit = useAppSelector(
(state) => (state) =>
state.server.getIn( state.server.getIn(
['server', 'configuration', 'media_attachments', 'description_limit'], [
'server',
'configuration',
'accounts',
'max_header_description_length',
],
150, 150,
) as number, ) as number,
); );
@ -100,6 +106,7 @@ export const ImageAltTextField: FC<{
<> <>
<img src={imageSrc} alt='' className={classes.altImage} /> <img src={imageSrc} alt='' className={classes.altImage} />
<div>
<TextAreaField <TextAreaField
label={ label={
<FormattedMessage <FormattedMessage
@ -117,6 +124,8 @@ export const ImageAltTextField: FC<{
value={altText} value={altText}
maxLength={altLimit} maxLength={altLimit}
/> />
<CharacterCounter currentString={altText} maxLength={altLimit} />
</div>
{!hideTip && ( {!hideTip && (
<Details <Details