mirror of
https://github.com/jwinterm/grim.git
synced 2026-12-03 11:13:57 +01:00
mnemonic: set phrase size on import, paste on confirmation
This commit is contained in:
@@ -203,12 +203,23 @@ impl WalletCreation {
|
||||
});
|
||||
});
|
||||
ui.add_space(4.0);
|
||||
} else {
|
||||
} else if step == Step::ConfirmMnemonic {
|
||||
ui.add_space(4.0);
|
||||
// Show next step or paste button.
|
||||
if step_available {
|
||||
ui.add_space(4.0);
|
||||
self.next_step_button_ui(ui, step, on_create);
|
||||
ui.add_space(4.0);
|
||||
} else {
|
||||
let paste_text = format!("{} {}", CLIPBOARD_TEXT, t!("paste").to_uppercase());
|
||||
View::button(ui, paste_text, Colors::white_or_black(false), || {
|
||||
let data = ZeroingString::from(cb.get_string_from_buffer().trim());
|
||||
self.mnemonic_setup.mnemonic.import_text(&data, true);
|
||||
});
|
||||
}
|
||||
ui.add_space(4.0);
|
||||
} else if step_available {
|
||||
ui.add_space(4.0);
|
||||
self.next_step_button_ui(ui, step, on_create);
|
||||
ui.add_space(4.0);
|
||||
}
|
||||
ui.add_space(4.0);
|
||||
}
|
||||
@@ -229,7 +240,7 @@ impl WalletCreation {
|
||||
let p_t = format!("{} {}", CLIPBOARD_TEXT, t!("paste").to_uppercase());
|
||||
View::button(ui, p_t, Colors::white_or_black(false), || {
|
||||
let data = ZeroingString::from(cb.get_string_from_buffer().trim());
|
||||
self.mnemonic_setup.mnemonic.import_text(&data);
|
||||
self.mnemonic_setup.mnemonic.import_text(&data, false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ impl MnemonicSetup {
|
||||
self.camera_content.clear_state();
|
||||
match &result {
|
||||
QrScanResult::Text(text) => {
|
||||
self.mnemonic.import_text(text);
|
||||
self.mnemonic.import_text(text, false);
|
||||
if self.mnemonic.is_valid_phrase() {
|
||||
modal.close();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user