Skip to content

Commit 087a169

Browse files
Fix Tooltip crash or bad display
1 parent 0cb621a commit 087a169

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib_nbgl/src/nbgl_use_case.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,10 +2271,10 @@ static void initWarningTipBox(const nbgl_tipBox_t *tipBox)
22712271
}
22722272

22732273
if ((tipBox != NULL) || (predefinedTipBoxText != NULL)) {
2274-
genericContext.validWarningCtx = true;
22752274
// do not display "Swipe to review" if a tip-box is displayed
22762275
STARTING_CONTENT.content.extendedCenter.contentCenter.subText = NULL;
22772276
if (predefinedTipBoxText != NULL) {
2277+
genericContext.validWarningCtx = true;
22782278
STARTING_CONTENT.content.extendedCenter.tipBox.icon = NULL;
22792279
STARTING_CONTENT.content.extendedCenter.tipBox.text = predefinedTipBoxText;
22802280
}
@@ -3569,6 +3569,7 @@ void nbgl_useCaseAdvancedReview(nbgl_operationType_t operationType,
35693569
const nbgl_warning_t *warning,
35703570
nbgl_choiceCallback_t choiceCallback)
35713571
{
3572+
memset(&reviewWithWarnCtx, 0, sizeof(reviewWithWarnCtx));
35723573
// memorize tipBox because it can be in the call stack of the caller
35733574
if (tipBox != NULL) {
35743575
memcpy(&activeTipBox, tipBox, sizeof(activeTipBox));
@@ -3599,7 +3600,6 @@ void nbgl_useCaseAdvancedReview(nbgl_operationType_t operationType,
35993600
operationType |= RISKY_OPERATION;
36003601
}
36013602

3602-
memset(&reviewWithWarnCtx, 0, sizeof(reviewWithWarnCtx));
36033603
reviewWithWarnCtx.isStreaming = false;
36043604
reviewWithWarnCtx.operationType = operationType;
36053605
reviewWithWarnCtx.tagValueList = tagValueList;

0 commit comments

Comments
 (0)