Skip to content

Commit

Permalink
Add go to settings callback
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPxt committed Jan 13, 2025
1 parent 8cbcc06 commit 8eed9b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/ui/view_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ void view_message_impl(const char *title, const char *message);

void view_error_show_impl();

void view_settings_show_impl();

void view_custom_error_show_impl();

void view_blindsign_error_show_impl();
Expand Down
19 changes: 17 additions & 2 deletions app/ui/view_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ static void h_blindsign_toggle() { app_mode_set_blindsign(!app_mode_blindsign())

static void confirm_error(__Z_UNUSED bool confirm) { h_error_accept(0); }

static void goto_settings(__Z_UNUSED bool confirm) {
view_settings_show_impl();
UX_WAIT();
app_reply_error();
}

static void reviewAddressChoice(bool confirm) {
if (confirm) {
nbgl_useCaseReviewStatus(STATUS_TYPE_ADDRESS_VERIFIED, h_approve_internal);
Expand Down Expand Up @@ -154,14 +160,23 @@ void view_custom_error_show(const char *upper, const char *lower) {
}

void view_blindsign_error_show() {
nbgl_useCaseChoice(&C_Warning_64px, "This message cannot\nbe clear-signed",
"Enable blind-signing in\nthe settings to sign\nthis transaction.", "Exit", "", confirm_error);
nbgl_useCaseChoice(&C_Warning_64px,
"This transaction cannot\nbe clear-signed",
"Enable blind signing in the\nsettings to sign this\ntransaction.",
"Go to settings",
"Reject Transaction",
goto_settings);
}

void view_error_show_impl() {
nbgl_useCaseChoice(&C_Important_Circle_64px, viewdata.key, viewdata.value, "Ok", NULL, confirm_setting);
}

void view_settings_show_impl() {
nbgl_useCaseGenericConfiguration("Settings", 0, &settingContents, app_quit);
}


static uint8_t get_pair_number() {
uint8_t numItems = 0;
uint8_t numPairs = 0;
Expand Down

0 comments on commit 8eed9b8

Please sign in to comment.