From f7b0a0345933b60b2ad2df03671f691dcafc5bda Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Tue, 30 Jul 2024 13:43:54 +0200 Subject: [PATCH] fix(core): fix pairing layout when only QR code or only Code Entry is selected [no changelog] --- core/src/trezor/wire/thp/pairing_context.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/trezor/wire/thp/pairing_context.py b/core/src/trezor/wire/thp/pairing_context.py index 0234a6eb2..a688cc246 100644 --- a/core/src/trezor/wire/thp/pairing_context.py +++ b/core/src/trezor/wire/thp/pairing_context.py @@ -30,13 +30,21 @@ class PairingDisplayData: self.code_nfc_unidirectional: bytes | None = None def get_display_layout(self) -> RustLayout: + # TODO have different layouts when there is only QR code or only Code Entry + qr_str = "" + code_str = "" + if self.code_qr_code is not None: + qr_str = self._get_code_qr_code_str() + if self.code_code_entry is not None: + code_str = self._get_code_code_entry_str() + return RustLayout( trezorui2.show_address_details( # noqa qr_title="Scan QR code to pair", - address=self._get_code_qr_code_str(), + address=qr_str, case_sensitive=True, details_title="", - account="Code to rewrite:\n" + self._get_code_code_entry_str(), + account="Code to rewrite:\n" + code_str, path="", xpubs=[], )