From d6cc46aacca0ad8fc13edda743957db404632372 Mon Sep 17 00:00:00 2001 From: Paul DeLucia <69597248+pauldelucia@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:28:20 +0700 Subject: [PATCH] feat: dont display seconds in dpns screen last updated column (#78) --- src/ui/dpns_contested_names_screen.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ui/dpns_contested_names_screen.rs b/src/ui/dpns_contested_names_screen.rs index 07a8443..11c4f41 100644 --- a/src/ui/dpns_contested_names_screen.rs +++ b/src/ui/dpns_contested_names_screen.rs @@ -412,10 +412,14 @@ impl DPNSContestedNamesScreen { let relative_time = HumanTime::from(datetime).to_string(); - ui.label(relative_time); + if relative_time.contains("seconds") { + ui.label("now"); + } else { + ui.label(relative_time); + } } else { - // Handle case where the timestamp is invalid - ui.label("Invalid timestamp"); + // Handle case where the timestamp is invalid + ui.label("Invalid timestamp"); } } else { ui.label("Fetching"); @@ -529,7 +533,11 @@ impl DPNSContestedNamesScreen { let relative_time = HumanTime::from(datetime).to_string(); - ui.label(relative_time); + if relative_time.contains("seconds") { + ui.label("now"); + } else { + ui.label(relative_time); + } } else { // Handle case where the timestamp is invalid ui.label("Invalid timestamp");