0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added in the right character count for bio when bio is present

refs https://github.com/TryGhost/Team/issues/1716
This commit is contained in:
James Morris 2022-08-04 15:33:52 +01:00
parent 5128360df4
commit 4cc2ed88c3

View file

@ -12,7 +12,11 @@ const AddNameDialog = (props) => {
const [bio, setBio] = useState(member.bio ?? '');
const maxBioChars = 50;
const [bioCharsLeft, setBioCharsLeft] = useState(maxBioChars);
let initialBioChars = maxBioChars;
if (member.bio) {
initialBioChars -= member.bio.length;
}
const [bioCharsLeft, setBioCharsLeft] = useState(initialBioChars);
const [error, setError] = useState({name: '', bio: ''});