this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix NameText not showing username when short

+14 -9
+14 -9
src/components/name-text.jsx
··· 20 20 external, 21 21 onClick, 22 22 }) { 23 - const { acct, avatar, avatarStatic, id, url, displayName, emojis, bot } = 24 - account; 25 - let { username } = account; 23 + const { 24 + acct, 25 + avatar, 26 + avatarStatic, 27 + id, 28 + url, 29 + displayName, 30 + emojis, 31 + bot, 32 + username, 33 + } = account; 26 34 const [_, acct1, acct2] = acct.match(/([^@]+)(@.+)/i) || [, acct]; 27 35 28 36 const trimmedUsername = username.toLowerCase().trim(); ··· 35 43 '', 36 44 ); // Remove non-alphanumeric characters 37 45 38 - if ( 46 + const hideUsername = 39 47 (!short && 40 48 (trimmedUsername === trimmedDisplayName || 41 49 trimmedUsername === shortenedDisplayName || 42 50 trimmedUsername === shortenedAlphaNumericDisplayName || 43 51 nameCollator.compare(trimmedUsername, shortenedDisplayName) === 0)) || 44 - shortenedAlphaNumericDisplayName === acct.toLowerCase() 45 - ) { 46 - username = null; 47 - } 52 + shortenedAlphaNumericDisplayName === acct.toLowerCase(); 48 53 49 54 return ( 50 55 <a ··· 83 88 <b> 84 89 <EmojiText text={displayName} emojis={emojis} /> 85 90 </b> 86 - {!showAcct && username && ( 91 + {!showAcct && !hideUsername && ( 87 92 <> 88 93 {' '} 89 94 <i>@{username}</i>