Fix NBGL EIP-191 occasional double-refresh on the sign page

This commit is contained in:
Alexandre Paillier
2023-06-29 14:33:50 +02:00
parent 82b40a6347
commit b458aa49cb

View File

@@ -82,11 +82,17 @@ static bool display_message(nbgl_pageContent_t *content) {
return true;
}
static void display_sign(nbgl_pageContent_t *content) {
content->type = INFO_LONG_PRESS, content->infoLongPress.icon = &C_Message_64px;
content->infoLongPress.text = TEXT_SIGN_EIP191;
content->infoLongPress.longPressText = SIGN_BUTTON;
g_position = UI_SIGNING_POSITION_SIGN;
static bool display_sign(nbgl_pageContent_t *content) {
bool ret = false;
if (g_position != UI_SIGNING_POSITION_SIGN) {
content->type = INFO_LONG_PRESS, content->infoLongPress.icon = &C_Message_64px;
content->infoLongPress.text = TEXT_SIGN_EIP191;
content->infoLongPress.longPressText = SIGN_BUTTON;
g_position = UI_SIGNING_POSITION_SIGN;
ret = true;
}
return ret;
}
static bool nav_callback(uint8_t page, nbgl_pageContent_t *content) {
@@ -105,7 +111,7 @@ static bool nav_callback(uint8_t page, nbgl_pageContent_t *content) {
}
} else {
// the last page must contain a long press button
display_sign(content);
ret = display_sign(content);
}
return ret;
}