Fix empty display/user name

If no display_name is profided, use username (without @instance)
This commit is contained in:
molan-git 2020-05-04 10:20:09 +02:00 committed by GitHub
parent ac26d6772b
commit ba39f51a5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,11 @@ Item {
left: parent.left left: parent.left
leftMargin: Theme.paddingMedium leftMargin: Theme.paddingMedium
} }
text: account_display_name text:
if (account_display_name === "") {
account_username.split('@')[0]
}
else account_display_name
width: contentWidth > parent.width /2 ? parent.width /2 : contentWidth width: contentWidth > parent.width /2 ? parent.width /2 : contentWidth
truncationMode: TruncationMode.Fade truncationMode: TruncationMode.Fade
font.weight: Font.Bold font.weight: Font.Bold