From de46af38aed6c476652f9b2b96c29cd0100e8643 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 3 Feb 2024 12:09:25 +0000 Subject: [PATCH] Only display _nonzero_ follow-request counts. Ahem. Of course I initially tested this in the difficult case, and forgot to check the easy one :-) --- src/menu.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/menu.rs b/src/menu.rs index 25a197e..8c24e08 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -270,19 +270,21 @@ pub fn main_menu(client: &mut Client) -> Box { .and_then(|ac| ac.source) .map(|s| s.follow_requests_count) { - menu.add_info_coloured( - ColouredString::uniform( - &format!( - "You have {} pending follow request{}!", - n, - if n == 1 { "" } else { "s" }, + if n > 0 { + menu.add_info_coloured( + ColouredString::uniform( + &format!( + "You have {} pending follow request{}!", + n, + if n == 1 { "" } else { "s" }, + ), + 'F', + ) + ColouredString::general( + " View with [ESC][Y][L][R]", + " HHHHHHHHHHHKKKHHKHHKHHKH", ), - 'F', - ) + ColouredString::general( - " View with [ESC][Y][L][R]", - " HHHHHHHHHHHKKKHHKHHKHHKH", - ), - ); + ); + } } Box::new(menu.finalise()) -- 2.30.2