mask recovery phrase input#367
Conversation
|
@leofelix077 could we make sure the recovery phrase is trimmed when we paste it? it's removing accent and lowercasing but it is not trimming so it still fails for me. also there is something not working correctly, when I paste a recovery phrase with uppercase and accents it fixes them but when I tap "Import wallet" it still throws an error as if the recovery phrase is wrong. Then if I delete a letter and re-type it and tap on "Importa wallet" then it works fine. another thing with the mask/unmask button: if you paste the recovery phrase then delete a single letter and tap on the mask/unmask button it doesn't work, it will only work for the new letters you type. For the ones that were pasted it takes no effect. |
|
@CassioMG simplified the logic a bit to remove the masking only from completed words (blur/focus logic) and adjusted the issues with the masked value on deletions. + the trimming for paste |
| export const normalizeAndTrimText = (text: string): string => | ||
| normalizeText(text).trim().replace(/\n/g, " "); | ||
| export const normalizeAndTrimRecoveryPhrase = (text: string): string => | ||
| normalizeRecoveryPhrase(text).trim().replace(/\n/g, " "); |
There was a problem hiding this comment.
@leofelix077 should we do the replace() here first and call trim() as the last action? So to avoid replacing a line break at the end of the string with a space which would break the validation
|
@leofelix077 thanks for the adjustments, the functionality/UX is looking great to me now. The only thing I noticed is that it's still displaying the Are you able to see the new error message on your device?
|
|
@CassioMG adjusted this part now |


Closes #306
Screen.Recording.2025-09-12.at.13.21.04.mov