Home page rework
Now explicitly shows if the app has been launched through a plugin or clone thanks to the new NBGL use case
This commit is contained in:
committed by
Clement Bouvet
parent
e950372438
commit
462c39aa4b
@@ -213,10 +213,10 @@ void ux_approve_tx(bool fromPlugin) {
|
||||
tx_approval_context.fromPlugin = fromPlugin;
|
||||
tx_approval_context.displayNetwork = false;
|
||||
|
||||
uint64_t chain_id = get_chain_id();
|
||||
uint64_t chain_id = get_tx_chain_id();
|
||||
if (chainConfig->chainId == ETHEREUM_MAINNET_CHAINID && chain_id != chainConfig->chainId) {
|
||||
tx_approval_context.displayNetwork = true;
|
||||
}
|
||||
|
||||
buildFirstPage();
|
||||
}
|
||||
}
|
||||
|
||||
+39
-2
@@ -1,7 +1,9 @@
|
||||
#include "common_ui.h"
|
||||
#include "shared_context.h"
|
||||
#include "ui_nbgl.h"
|
||||
#include "nbgl_use_case.h"
|
||||
#include "glyphs.h"
|
||||
#include "network.h"
|
||||
|
||||
nbgl_page_t* pageContext;
|
||||
|
||||
@@ -19,5 +21,40 @@ void app_quit(void) {
|
||||
}
|
||||
|
||||
void ui_idle(void) {
|
||||
nbgl_useCaseHome(APPNAME, &ICONGLYPH, NULL, true, ui_menu_settings, app_quit);
|
||||
}
|
||||
if (plugin_name != NULL) { // plugin
|
||||
nbgl_useCasePlugInHome((char*)plugin_name,
|
||||
APPNAME,
|
||||
&C_stax_app_ethereum,
|
||||
NULL,
|
||||
NULL,
|
||||
true,
|
||||
ui_menu_settings,
|
||||
app_quit);
|
||||
} else {
|
||||
char *app_name = (char*) get_app_network_name();
|
||||
|
||||
switch (get_app_chain_id()) {
|
||||
// Standalone apps
|
||||
case 1: // Mainnet
|
||||
case 3: // Ropsten
|
||||
case 5: // Goerli
|
||||
nbgl_useCaseHome(app_name,
|
||||
&ICONGLYPH,
|
||||
NULL,
|
||||
true,
|
||||
ui_menu_settings,
|
||||
app_quit);
|
||||
break;
|
||||
// Clones
|
||||
default:
|
||||
nbgl_useCasePlugInHome(app_name ? app_name : "???",
|
||||
APPNAME,
|
||||
&C_stax_app_ethereum,
|
||||
NULL,
|
||||
NULL,
|
||||
true,
|
||||
ui_menu_settings,
|
||||
app_quit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user