From 2284b338c825252dcf8f179509f5ca330dfd52d5 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 20 Feb 2025 16:05:44 +0200 Subject: [PATCH] feat(core): skip empty fee entry in `UICaesar::confirm_summary` Otherwise, we may get an additional empty confirmation screen. [no changelog] --- .../rust/src/ui/layout_caesar/ui_firmware.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs b/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs index d6f8393e24..e1b66322da 100644 --- a/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs +++ b/core/embed/rust/src/ui/layout_caesar/ui_firmware.rs @@ -548,15 +548,19 @@ impl FirmwareUI for UICaesar { // Total amount + fee let (btn_layout, btn_actions) = btns_summary_page(!info_pages.is_empty()); - let ops = OpTextLayout::new(theme::TEXT_MONO) + let mut ops = OpTextLayout::new(theme::TEXT_MONO) .text(amount_label, fonts::FONT_BOLD) .newline() - .text(amount, fonts::FONT_MONO) - .newline() - .newline() - .text(fee_label, fonts::FONT_BOLD) - .newline() - .text(fee, fonts::FONT_MONO); + .text(amount, fonts::FONT_MONO); + + if !fee_label.is_empty() || !fee.is_empty() { + ops = ops + .newline() + .newline() + .text(fee_label, fonts::FONT_BOLD) + .newline() + .text(fee, fonts::FONT_MONO); + } let formatted = FormattedText::new(ops); Page::new(btn_layout, btn_actions, formatted)