diff --git a/src_nbgl/ui_message_signing.c b/src_nbgl/ui_message_signing.c index 582426b..36a452c 100644 --- a/src_nbgl/ui_message_signing.c +++ b/src_nbgl/ui_message_signing.c @@ -4,25 +4,19 @@ #include "ui_message_signing.h" #include "glyphs.h" -static void (*g_resume_func)(void) = NULL; static void (*g_approved_func)(void) = NULL; static void (*g_rejected_func)(void) = NULL; -static void ui_message_rejection_handler(bool confirm) { - if (confirm) { - nbgl_useCaseStatus("Message signing\ncancelled", false, g_rejected_func); - } else { - (*g_resume_func)(); - } +static void ui_message_rejection_handler() { + nbgl_useCaseStatus("Message signing\ncancelled", false, g_rejected_func); } static void ui_message_confirm_rejection(void) { - nbgl_useCaseChoice(&C_warning64px, - REJECT_QUESTION(TEXT_MESSAGE), - NULL, - REJECT_CONFIRM_BUTTON, - RESUME(TEXT_MESSAGE), - ui_message_rejection_handler); + nbgl_useCaseConfirm(REJECT_QUESTION(TEXT_MESSAGE), + NULL, + REJECT_CONFIRM_BUTTON, + RESUME(TEXT_MESSAGE), + ui_message_rejection_handler); } void ui_message_review_choice(bool confirm) { @@ -35,10 +29,8 @@ void ui_message_review_choice(bool confirm) { void ui_message_start(const char *title, void (*start_func)(void), - void (*resume_func)(void), void (*approved_func)(void), void (*rejected_func)(void)) { - g_resume_func = resume_func; g_approved_func = approved_func; g_rejected_func = rejected_func; nbgl_useCaseReviewStart(&C_Message_64px, diff --git a/src_nbgl/ui_message_signing.h b/src_nbgl/ui_message_signing.h index 6946736..008f574 100644 --- a/src_nbgl/ui_message_signing.h +++ b/src_nbgl/ui_message_signing.h @@ -11,7 +11,6 @@ void ui_message_review_choice(bool confirm); void ui_message_start(const char *title, void (*start_func)(void), - void (*resume_func)(void), void (*approved_func)(void), void (*rejected_func)(void)); diff --git a/src_nbgl/ui_sign_712.c b/src_nbgl/ui_sign_712.c index 032e312..d17a1d3 100644 --- a/src_nbgl/ui_sign_712.c +++ b/src_nbgl/ui_sign_712.c @@ -67,27 +67,10 @@ static void handle_display(nbgl_navCallback_t cb) { nbgl_useCaseRegularReview(0, 0, REJECT_BUTTON, NULL, cb, ui_message_review_choice); } -static void resume_review(void) { - switch (g_position) { - case UI_SIGNING_POSITION_START: - ui_712_start(); - break; - case UI_SIGNING_POSITION_REVIEW: - ui_712_switch_to_message(); - break; - case UI_SIGNING_POSITION_SIGN: - ui_712_switch_to_sign(); - break; - default: - return; // should not happen - } -} - void ui_712_start(void) { g_position = UI_SIGNING_POSITION_START; ui_message_start(TEXT_REVIEW_EIP712, &ui_712_switch_to_message, - &resume_review, &ui_message_712_approved, &ui_message_712_rejected); } diff --git a/src_nbgl/ui_sign_712_v0.c b/src_nbgl/ui_sign_712_v0.c index 8719f5d..bc82563 100644 --- a/src_nbgl/ui_sign_712_v0.c +++ b/src_nbgl/ui_sign_712_v0.c @@ -70,19 +70,10 @@ static void start_review(void) { display_review(); } -static void resume_review(void) { - if (g_position == UI_SIGNING_POSITION_START) { - ui_sign_712_v0(); - } else { - display_review(); - } -} - void ui_sign_712_v0(void) { g_position = UI_SIGNING_POSITION_START; ui_message_start(TEXT_REVIEW_EIP712, &start_review, - &resume_review, &ui_message_712_approved, &ui_message_712_rejected); } diff --git a/src_nbgl/ui_sign_message.c b/src_nbgl/ui_sign_message.c index b785745..4577fa6 100644 --- a/src_nbgl/ui_sign_message.c +++ b/src_nbgl/ui_sign_message.c @@ -120,18 +120,6 @@ static void continue_review(void) { nbgl_useCaseForwardOnlyReview(REJECT_BUTTON, NULL, nav_callback, ui_message_review_choice); } -static void resume_message(void) { - e_ui_191_action action_bak = g_action; - - if (g_position == UI_SIGNING_POSITION_START) { - ui_191_start(); - } else { - g_action = UI_191_ACTION_IDLE; - continue_review(); - g_action = action_bak; - } -} - void ui_191_start(void) { g_position = UI_SIGNING_POSITION_START; @@ -139,11 +127,7 @@ void ui_191_start(void) { eip191MessageIdx = 0; stringsTmpTmpIdx = 0; - ui_message_start(TEXT_REVIEW_EIP191, - &ui_191_switch_to_message, - &resume_message, - &sign_message, - &reject_message); + ui_message_start(TEXT_REVIEW_EIP191, &ui_191_switch_to_message, &sign_message, &reject_message); } void ui_191_switch_to_message(void) {