Skip to content

Commit

Permalink
Merge pull request #172 from Zondax/intro_sub_msg
Browse files Browse the repository at this point in the history
Review Screen sub msg
  • Loading branch information
0xPxt authored Feb 12, 2025
2 parents ce2f06b + ec983bf commit 339bcf5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions app/ui/view_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ extern bolos_ux_params_t G_ux_params;
extern unsigned int review_type;

const char *intro_message = NULL;
const char *intro_submessage = NULL;
char intro_msg_buf[MAX_CHARS_PER_VALUE1_LINE];
char intro_submsg_buf[MAX_CHARS_PER_VALUE1_LINE];

static nbgl_layoutTagValue_t pairs[NB_MAX_DISPLAYED_PAIRS_IN_REVIEW];

Expand Down Expand Up @@ -460,11 +462,11 @@ static void config_useCaseReview(nbgl_operationType_t type) {
pairList.startIndex = 0;
if (app_mode_blindsign_required()) {
nbgl_useCaseReviewBlindSigning(type, &pairList, &C_icon_stax_64,
(intro_message == NULL ? "Review transaction" : intro_message), NULL,
(intro_message == NULL ? "Review transaction" : intro_message), (intro_submessage == NULL ? NULL : intro_submessage),
"Accept risk and sign transaction ?", NULL, reviewTransactionChoice);
} else {
nbgl_useCaseReview(type, &pairList, &C_icon_stax_64,
(intro_message == NULL ? "Review transaction" : intro_message), NULL, APPROVE_LABEL_NBGL,
(intro_message == NULL ? "Review transaction" : intro_message), (intro_submessage == NULL ? NULL : intro_submessage), APPROVE_LABEL_NBGL,
reviewTransactionChoice);
}
}
Expand All @@ -491,16 +493,21 @@ void view_review_show_impl(unsigned int requireReply, const char *title, const c
review_type = (review_type_e)requireReply;

intro_message = NULL;
intro_submessage = NULL;
intro_msg_buf[0] = '\0';
intro_submsg_buf[0] = '\0';
viewdata.key = viewdata.keys[0];
viewdata.value = viewdata.values[0];
// Retrieve intro text for transaction
if (viewdata.viewfuncGetItem != NULL) {
viewdata.viewfuncGetItem(0xFF, viewdata.key, MAX_CHARS_PER_KEY_LINE, intro_msg_buf,
viewdata.viewfuncGetItem(0xFF, intro_msg_buf, MAX_CHARS_PER_KEY_LINE, intro_submsg_buf,
MAX_CHARS_PER_VALUE1_LINE, 0, &viewdata.pageCount);
if (strlen(intro_msg_buf) > strlen(" ")) {
intro_message = intro_msg_buf;
}
if (strlen(intro_submsg_buf) > strlen(" ")) {
intro_submessage = intro_submsg_buf;
}
}
h_paging_init();

Expand Down
2 changes: 1 addition & 1 deletion include/zxversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

#define ZXLIB_MAJOR 32
#define ZXLIB_MINOR 1
#define ZXLIB_PATCH 3
#define ZXLIB_PATCH 4

0 comments on commit 339bcf5

Please sign in to comment.