From 531734108002065e03bc11abc24061bf452cebcc Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sat, 10 Feb 2024 17:13:13 -0800 Subject: [PATCH] name: don't render display_name first if its empty Signed-off-by: William Casarin --- src/app.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.rs b/src/app.rs index 174a7356..b82a1c4c 100644 --- a/src/app.rs +++ b/src/app.rs @@ -482,8 +482,8 @@ fn render_username(ui: &mut egui::Ui, profile: Option<&ProfileRecord>, _pk: &[u8 //ui.spacing_mut().item_spacing.x = 0.0; if let Some(profile) = profile { if let Some(prof) = profile.record.profile() { - if let Some(display_name) = prof.display_name() { - ui_abbreviate_name(ui, display_name, 20); + if prof.display_name().is_some() && prof.display_name().unwrap() != "" { + ui_abbreviate_name(ui, prof.display_name().unwrap(), 20); } else if let Some(name) = prof.name() { ui_abbreviate_name(ui, name, 20); }