@@ -263,7 +263,7 @@ void flipbip_scene_1_draw(Canvas* canvas, FlipBipScene1Model* model) {
263
263
264
264
}
265
265
266
- static void flipbip_scene_1_model_init (FlipBipScene1Model * const model , const int strength , const uint32_t coin ) {
266
+ static void flipbip_scene_1_model_init (FlipBipScene1Model * const model , const int strength , const uint32_t coin , const bool overwrite ) {
267
267
268
268
model -> page = 0 ;
269
269
model -> coin = coin ;
@@ -273,8 +273,8 @@ static void flipbip_scene_1_model_init(FlipBipScene1Model* const model, const in
273
273
char * mnemonic = malloc (256 );
274
274
memzero (mnemonic , 256 );
275
275
276
- // Check if the mnemonic key & data is already saved in persistent storage
277
- if (!flipbip_has_settings (true) && !flipbip_has_settings (false)) {
276
+ // Check if the mnemonic key & data is already saved in persistent storage, or overwrite is true
277
+ if (overwrite || ( !flipbip_has_settings (true) && !flipbip_has_settings (false) )) {
278
278
// Generate a random mnemonic using trezor-crypto
279
279
const char * mnemonic_gen = mnemonic_generate (strength );
280
280
// Save the mnemonic to persistent storage
@@ -476,14 +476,17 @@ void flipbip_scene_1_enter(void* context) {
476
476
uint32_t coin = 0 ; //FlipBipCoinBTC0 // BTC (0)
477
477
if (coin_setting == FlipBipCoinETH60 ) coin = 60 ; // ETH (60)
478
478
479
+ // Overwrite the saved seed with a new one setting
480
+ bool overwrite = app -> overwrite_saved_seed != 0 ;
481
+
479
482
flipbip_play_happy_bump (app );
480
483
flipbip_led_set_rgb (app , 255 , 0 , 0 );
481
484
482
485
with_view_model (
483
486
instance -> view ,
484
487
FlipBipScene1Model * model ,
485
488
{
486
- flipbip_scene_1_model_init (model , strength , coin );
489
+ flipbip_scene_1_model_init (model , strength , coin , overwrite );
487
490
},
488
491
true
489
492
);
0 commit comments