From: Simon Tatham Date: Sat, 3 Feb 2024 12:09:25 +0000 (+0000) Subject: Only display _nonzero_ follow-request counts. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=de46af38aed6c476652f9b2b96c29cd0100e8643;p=mastodonochrome.git Only display _nonzero_ follow-request counts. Ahem. Of course I initially tested this in the difficult case, and forgot to check the easy one :-) --- 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())