]> cat aescling's git repositories - mastodon.git/commitdiff
Fix empty display name precedence over username in web UI (#9163)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 30 Oct 2018 16:06:12 +0000 (17:06 +0100)
committerGitHub <noreply@github.com>
Tue, 30 Oct 2018 16:06:12 +0000 (17:06 +0100)
Fix #9131

app/javascript/mastodon/actions/importer/normalizer.js

index a2af3222e72a4519965186044b2edd9fafbeafb0..34a4150facb90c521a9e82f8142d20ebb2507a67 100644 (file)
@@ -14,7 +14,7 @@ export function normalizeAccount(account) {
   account = { ...account };
 
   const emojiMap = makeEmojiMap(account);
-  const displayName = account.display_name.length === 0 ? account.username : account.display_name;
+  const displayName = account.display_name.trim().length === 0 ? account.username : account.display_name;
 
   account.display_name_html = emojify(escapeTextContentForBrowser(displayName), emojiMap);
   account.note_emojified = emojify(account.note, emojiMap);