diff --git a/src/apps/common/request_pin.py b/src/apps/common/request_pin.py index 82eb3eb77b..c0d9f091c2 100644 --- a/src/apps/common/request_pin.py +++ b/src/apps/common/request_pin.py @@ -36,6 +36,17 @@ async def request_pin( c.taint() c.render() + c = dialog.confirm + if matrix.pin: + if not c.is_enabled(): + c.enable() + c.taint() + else: + if c.is_enabled(): + c.disable() + c.taint() + c.render() + if label is None: label = "Enter your PIN" sublabel = None @@ -59,6 +70,8 @@ async def request_pin( else: result = await dialog if result == CONFIRMED: + if not matrix.pin: + continue return matrix.pin elif matrix.pin: # reset matrix.change("") diff --git a/src/trezor/ui/button.py b/src/trezor/ui/button.py index 5d39410a77..75f5e427d2 100644 --- a/src/trezor/ui/button.py +++ b/src/trezor/ui/button.py @@ -36,6 +36,9 @@ class Button(Widget): self.state = BTN_DISABLED self.tainted = True + def is_enabled(self): + return self.state != BTN_DISABLED + def render(self): if not self.tainted: return