Properly handle empty usernames
This commit is contained in:
parent
1fe1562ef2
commit
d1cb84ba29
|
@ -351,7 +351,10 @@ class _AboutTab extends HookWidget {
|
|||
),
|
||||
),
|
||||
...site.admins.map((e) => ListTile(
|
||||
title: Text(e.preferredUsername ?? '@${e.name}'),
|
||||
title: Text((e.preferredUsername == null ||
|
||||
e.preferredUsername.isEmpty)
|
||||
? '@${e.name}'
|
||||
: e.preferredUsername),
|
||||
subtitle: e.bio != null ? MarkdownText(e.bio) : null,
|
||||
onTap: () => goToUser(e.id),
|
||||
leading: e.avatar != null
|
||||
|
|
|
@ -28,7 +28,10 @@ class UsersListPage extends StatelessWidget {
|
|||
),
|
||||
body: ListView.builder(
|
||||
itemBuilder: (context, i) => ListTile(
|
||||
title: Text(users[i].preferredUsername ?? '@${users[i].name}'),
|
||||
title: Text((users[i].preferredUsername == null ||
|
||||
users[i].preferredUsername.isEmpty)
|
||||
? '@${users[i].name}'
|
||||
: users[i].preferredUsername),
|
||||
subtitle: users[i].bio != null
|
||||
? Opacity(
|
||||
opacity: 0.5,
|
||||
|
|
Loading…
Reference in New Issue