Skip to content

Commit

Permalink
fix(wallet-setup): mnemonic input (#3219)
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Apr 29, 2024
1 parent a04e3f1 commit 54b4a17
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export const RestoreWalletScreen = () => {

const onSelect = (index: number, word: string) => {
const newWords = [...mnemonicSelectedWords]
setMnemonicSelectedWords(newWords)
setSuggestedWords([])
newWords[index] = word
setSuggestedWords([])
setMnemonicSelectedWords(newWords)
mnenonicRefs[index].current?.selectWord(isEmptyString(word) ? '' : word)

const mnemonicWordsComplete = newWords.every(Boolean)
Expand All @@ -72,15 +72,14 @@ export const RestoreWalletScreen = () => {
if (mnemonicWordsComplete && isValid) {
Keyboard.dismiss()
setIsValidPhrase(true)
setMnemonic(mnemonicSelectedWords.join(' '))
setMnemonic(newWords.join(' '))
track.restoreWalletEnterPhraseStepStatus({recovery_prhase_status: true})

return
}

if (mnemonicWordsComplete && !isValid) {
setIsValidPhrase(false)
setMnemonic(mnemonicSelectedWords.join(' '))
track.restoreWalletEnterPhraseStepStatus({recovery_prhase_status: false})

return
Expand Down

0 comments on commit 54b4a17

Please sign in to comment.