mnemonic: trim input word

This commit is contained in:
ardocrat 2024-06-25 16:48:44 +03:00
parent c3c53ac003
commit 735e9ad94d

View file

@ -304,6 +304,8 @@ impl MnemonicSetup {
columns[1].vertical_centered_justified(|ui| { columns[1].vertical_centered_justified(|ui| {
// Callback to save the word. // Callback to save the word.
let mut save = || { let mut save = || {
self.word_edit = self.word_edit.trim().to_string();
// Check if word is valid. // Check if word is valid.
let word_index = self.word_num_edit - 1; let word_index = self.word_num_edit - 1;
if !self.mnemonic.is_valid_word(&self.word_edit, word_index) { if !self.mnemonic.is_valid_word(&self.word_edit, word_index) {