Made the hacky 712 generic step redraw a function

This commit is contained in:
Alexandre Paillier
2022-06-16 17:52:08 +02:00
parent 07aca18ab1
commit 56e0875979
2 changed files with 12 additions and 7 deletions

View File

@@ -66,6 +66,16 @@ void ui_712_set_value(const char *const str, uint8_t length)
ui_712_set_buf(str, length, strings.tmp.tmp, sizeof(strings.tmp.tmp), true);
}
void ui_712_redraw_generic_step(void)
{
// not pretty, manually changes the internal state of the UX flow
// so that we always land on the first screen of a paging step without any visible
// screen glitching (quick screen switching)
G_ux.flow_stack[G_ux.stack_count - 1].index = 0;
// since the flow now thinks we are displaying the first step, do next
ux_flow_next();
}
/**
* Called on the intermediate dummy screen between the dynamic step
* && the approve/reject screen
@@ -265,13 +275,7 @@ void ui_712_new_field(const void *const field_ptr, const uint8_t *const data,
default:
PRINTF("Unhandled type\n");
}
// not pretty, manually changes the internal state of the UX flow
// so that we always land on the first screen of a paging step without any visible
// screen glitching (quick screen switching)
G_ux.flow_stack[G_ux.stack_count - 1].index = 0;
// since the flow now thinks we are displaying the first step, do next
ux_flow_next();
ui_712_redraw_generic_step();
}
/**

View File

@@ -32,6 +32,7 @@ void ui_712_set_value(const char *const str, uint8_t length);
#ifdef HAVE_EIP712_HALF_BLIND
void ui_712_message_hash(void);
#endif // HAVE_EIP712_HALF_BLIND
void ui_712_redraw_generic_step(void);
#endif // HAVE_EIP712_FULL_SUPPORT