Skip to content

Commit

Permalink
nbgl_use_case: Fix blind sign warning icon
Browse files Browse the repository at this point in the history
Blind sign warning icon was always displayed during streaming review.
Only display icon in first and last review page.
  • Loading branch information
abonnaudet-ledger committed Jul 24, 2024
1 parent f34a50b commit 5f6661f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,12 +907,17 @@ static bool genericContextPreparePageContent(const nbgl_content_t *p_content,
LOG_DEBUG(USE_CASE_LOGGER, "Unsupported type %d\n", pageContent->type);
return false;
}
// if first or last page of review and blind operation, add the top-right button
if (((p_content == &STARTING_CONTENT) || (p_content->type == INFO_LONG_PRESS))
&& (((navType == STREAMING_NAV)
&& (bundleNavContext.reviewStreaming.operationType & BLIND_OPERATION))
|| ((navType == GENERIC_NAV)
&& (bundleNavContext.review.operationType & BLIND_OPERATION)))) {

bool isFirstOrLastPage
= (p_content->type == CENTERED_INFO) || (p_content->type == INFO_LONG_PRESS);
bool isStreamingNavAndBlindOperation
= (navType == STREAMING_NAV)
&& (bundleNavContext.reviewStreaming.operationType & BLIND_OPERATION);
bool isGenericNavAndBlindOperation
= (navType == GENERIC_NAV) && (bundleNavContext.review.operationType & BLIND_OPERATION);

// if first or last page of review and blind operation, add the warning top-right button
if (isFirstOrLastPage && (isStreamingNavAndBlindOperation || isGenericNavAndBlindOperation)) {
pageContent->topRightIcon = &WARNING_ICON;
pageContent->topRightToken = BLIND_WARNING_TOKEN;
}
Expand Down

0 comments on commit 5f6661f

Please sign in to comment.