Skip to content

Commit

Permalink
fixup! chore(core): adapt wipe pin flow
Browse files Browse the repository at this point in the history
  • Loading branch information
bieleluk committed Dec 18, 2024
1 parent 8dccc8e commit 8f8b813
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
1 change: 0 additions & 1 deletion core/embed/rust/librust_qstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ static void _librust_qstrs(void) {
MP_QSTR_pin__should_be_long;
MP_QSTR_pin__title_check_pin;
MP_QSTR_pin__title_settings;
MP_QSTR_pin__title_setup;
MP_QSTR_pin__title_wrong_pin;
MP_QSTR_pin__tries_left;
MP_QSTR_pin__turn_off;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion core/mocks/trezortranslate_keys.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ class TR:
pin__should_be_long: str = "PIN should be 4-50 digits long."
pin__title_check_pin: str = "Check PIN"
pin__title_settings: str = "PIN"
pin__title_setup: str = "Set PIN"
pin__title_wrong_pin: str = "Wrong PIN"
pin__tries_left: str = "tries left"
pin__turn_off: str = "Are you sure you want to turn off PIN protection?"
Expand Down
13 changes: 9 additions & 4 deletions core/src/apps/management/change_pin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import TYPE_CHECKING

from trezor import TR, config, wire
from trezor import TR, config, utils, wire

if TYPE_CHECKING:
from typing import Awaitable
Expand Down Expand Up @@ -67,10 +67,15 @@ def _require_confirm_change_pin(msg: ChangePin) -> Awaitable[None]:

has_pin = config.has_pin()

if utils.UI_LAYOUT == "MERCURY":
title = TR.pin__title_settings
else:
title = TR.pin__title_settings + " " + TR.words__settings

if msg.remove and has_pin: # removing pin
return confirm_action(
"disable_pin",
TR.pin__title_settings,
title,
subtitle=TR.words__settings,
description=TR.pin__turn_off,
verb=TR.buttons__turn_off,
Expand All @@ -79,7 +84,7 @@ def _require_confirm_change_pin(msg: ChangePin) -> Awaitable[None]:
if not msg.remove and has_pin: # changing pin
return confirm_action(
"change_pin",
TR.pin__title_settings,
title,
subtitle=TR.words__settings,
description=TR.pin__change,
verb=TR.buttons__change,
Expand All @@ -89,7 +94,7 @@ def _require_confirm_change_pin(msg: ChangePin) -> Awaitable[None]:
if not msg.remove and not has_pin: # setting new pin
return confirm_set_new_pin(
"set_pin",
TR.pin__title_setup,
title,
TR.pin__turn_on,
TR.pin__cancel_setup,
TR.pin__info,
Expand Down
13 changes: 9 additions & 4 deletions core/src/apps/management/change_wipe_code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import TYPE_CHECKING

from trezor import TR
from trezor import TR, utils

if TYPE_CHECKING:
from typing import Awaitable
Expand Down Expand Up @@ -62,10 +62,15 @@ def _require_confirm_action(
from trezor.ui.layouts import confirm_action, confirm_set_new_pin
from trezor.wire import ProcessError

if utils.UI_LAYOUT == "MERCURY":
title = TR.wipe_code__title_settings
else:
title = TR.wipe_code__title_settings + " " + TR.words__settings

if msg.remove and has_wipe_code:
return confirm_action(
"disable_wipe_code",
TR.wipe_code__title_settings,
title,
subtitle=TR.words__settings,
description=TR.wipe_code__turn_off,
verb=TR.buttons__turn_off,
Expand All @@ -75,7 +80,7 @@ def _require_confirm_action(
if not msg.remove and has_wipe_code:
return confirm_action(
"change_wipe_code",
TR.wipe_code__title_settings,
title,
subtitle=TR.words__settings,
description=TR.wipe_code__change,
verb=TR.buttons__change,
Expand All @@ -84,7 +89,7 @@ def _require_confirm_action(
if not msg.remove and not has_wipe_code:
return confirm_set_new_pin(
"set_wipe_code",
TR.wipe_code__title_settings,
title,
TR.wipe_code__turn_on,
TR.buttons__cancel,
TR.wipe_code__info,
Expand Down
1 change: 0 additions & 1 deletion core/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@
"pin__should_be_long": "PIN should be 4-50 digits long.",
"pin__title_check_pin": "Check PIN",
"pin__title_settings": "PIN",
"pin__title_setup": "Set PIN",
"pin__title_wrong_pin": "Wrong PIN",
"pin__tries_left": "tries left",
"pin__turn_off": "Are you sure you want to turn off PIN protection?",
Expand Down
3 changes: 1 addition & 2 deletions core/translations/order.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,5 @@
"971": "instructions__view_all_data",
"972": "ethereum__interaction_contract",
"973": "misc__enable_labeling",
"974": "ethereum__unknown_contract_address_short",
"975": "pin__title_setup"
"974": "ethereum__unknown_contract_address_short"
}
6 changes: 3 additions & 3 deletions core/translations/signatures.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"current": {
"merkle_root": "5d84adedeb092763cb7dbef280fdfecb51b7741ef7684b8e8203d636ab8a780d",
"datetime": "2024-12-16T16:01:00.535850",
"commit": "78cce0ba04436b2ec8a72d00d157a1dd37055572"
"merkle_root": "53515eead12df806f139761eddc91f2aa2d3de3b9e0eb831552167ee25897f4a",
"datetime": "2024-12-18T22:06:09.895866",
"commit": "8dccc8e1d52ff8900bf7ef2a563ba230464fc831"
},
"history": [
{
Expand Down

0 comments on commit 8f8b813

Please sign in to comment.