Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
steel97 committed Oct 14, 2024
1 parent c61262c commit 2c6117c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
10 changes: 5 additions & 5 deletions src/commands/deriveaddress/da_ui_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ int ui_display_address(derive_address_ctx_t* ctx,
pairs_global[n_pairs++] = ui_application_id_screen(app_access_token, ctx->app_id);
}

pairList.nbMaxLinesForValue = 0;
pairList.nbPairs = n_pairs;
pairList.pairs = pairs_global;
pair_list.nbMaxLinesForValue = 0;
pair_list.nbPairs = n_pairs;
pair_list.pairs = pairs_global;

if (send) {
// Confirm Send Address
nbgl_useCaseAddressReview(ctx->address,
n_pairs == 0 ? NULL : &pairList,
n_pairs == 0 ? NULL : &pair_list,
&WHEEL_ICON,
"Confirm Send Address",
"",
ui_display_address_confirm);
} else {
// Confirm Address
nbgl_useCaseAddressReview(ctx->address,
n_pairs == 0 ? NULL : &pairList,
n_pairs == 0 ? NULL : &pair_list,
&INFO_I_ICON,
"Confirm Address",
"",
Expand Down
24 changes: 12 additions & 12 deletions src/commands/signtx/stx_ui_nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ bool ui_stx_add_operation_approve_screens(sign_transaction_ui_aprove_ctx_t* ctx,
ctx->sign_tx_context = sign_tx;
ctx->is_known_application = is_known_application;

pairList.nbMaxLinesForValue = 0;
pairList.nbPairs = n_pairs;
pairList.pairs = pairs_global;
pair_list.nbMaxLinesForValue = 0;
pair_list.nbPairs = n_pairs;
pair_list.pairs = pairs_global;

bool approved = true;
if (n_pairs > 0) {
nbgl_useCaseReviewStreamingContinue(&pairList, ui_stx_operation_approve_action);
nbgl_useCaseReviewStreamingContinue(&pair_list, ui_stx_operation_approve_action);
approved = io_ui_process();
}

Expand Down Expand Up @@ -305,11 +305,11 @@ bool ui_stx_add_output_screens(sign_transaction_ui_output_confirm_ctx_t* ctx,
n_pairs++;
}

pairList.nbMaxLinesForValue = 0;
pairList.nbPairs = n_pairs;
pairList.pairs = pairs_global;
pair_list.nbMaxLinesForValue = 0;
pair_list.nbPairs = n_pairs;
pair_list.pairs = pairs_global;

nbgl_useCaseReviewStreamingContinue(&pairList, ui_stx_operation_approve_action);
nbgl_useCaseReviewStreamingContinue(&pair_list, ui_stx_operation_approve_action);

bool approved = io_ui_process();

Expand Down Expand Up @@ -374,11 +374,11 @@ bool ui_stx_add_transaction_screens(sign_transaction_ui_sign_confirm_ctx_t* ctx,
n_pairs++;
}

pairList.nbMaxLinesForValue = 0;
pairList.nbPairs = n_pairs;
pairList.pairs = pairs_global;
pair_list.nbMaxLinesForValue = 0;
pair_list.nbPairs = n_pairs;
pair_list.pairs = pairs_global;

nbgl_useCaseReviewStreamingContinue(&pairList, ui_stx_operation_approve_action);
nbgl_useCaseReviewStreamingContinue(&pair_list, ui_stx_operation_approve_action);

bool approved = io_ui_process();
if (!approved) {
Expand Down
4 changes: 1 addition & 3 deletions src/ui/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ bool io_ui_process();
#ifdef HAVE_NBGL
#define N_UX_PAIRS 13

static nbgl_layoutTagValue_t pairs[N_UX_PAIRS];
static nbgl_layoutTagValueList_t pairList;

static nbgl_layoutTagValueList_t pair_list;
extern nbgl_layoutTagValue_t pairs_global[N_UX_PAIRS];

static char pair_mem_title[N_UX_PAIRS][20];
Expand Down

0 comments on commit 2c6117c

Please sign in to comment.