mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-09 10:03:36 +00:00
fix: change mnemonic var name to new
This commit is contained in:
parent
d1fed2c580
commit
cb39622ab6
@ -37,8 +37,8 @@ const AutocompleteInput = ({ index }: AutocompleteInputProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const value = e.target.value
|
const value = e.target.value
|
||||||
const mnemonic = value.trim().split(' ').slice(0, 24)
|
const newMnemonic = value.trim().split(' ').slice(0, 24)
|
||||||
const mnemonicLength = mnemonic.length
|
const mnemonicLength = newMnemonic.length
|
||||||
let newValidWords = [...validWords]
|
let newValidWords = [...validWords]
|
||||||
|
|
||||||
if (mnemonicLength === 1) {
|
if (mnemonicLength === 1) {
|
||||||
@ -46,15 +46,15 @@ const AutocompleteInput = ({ index }: AutocompleteInputProps) => {
|
|||||||
newValidWords[index] =
|
newValidWords[index] =
|
||||||
generatedMnemonic[index] === value || generatedMnemonic[index].startsWith(value)
|
generatedMnemonic[index] === value || generatedMnemonic[index].startsWith(value)
|
||||||
} else if (mnemonicLength === 24) {
|
} else if (mnemonicLength === 24) {
|
||||||
dispatch(setMnemonic(mnemonic))
|
dispatch(setMnemonic(newMnemonic))
|
||||||
dispatch(setIsCopyPastedPhrase(true))
|
dispatch(setIsCopyPastedPhrase(true))
|
||||||
|
|
||||||
mnemonic.forEach((m, i) => {
|
newMnemonic.forEach((m, i) => {
|
||||||
newValidWords[i] = generatedMnemonic[i] === m
|
newValidWords[i] = generatedMnemonic[i] === m
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
for (let i = index; i < mnemonicLength + index; i++) {
|
for (let i = index; i < mnemonicLength + index; i++) {
|
||||||
const mnemonicWord = mnemonic.shift() || ''
|
const mnemonicWord = newMnemonic.shift() || ''
|
||||||
dispatch(setWord({ index: i, word: mnemonicWord }))
|
dispatch(setWord({ index: i, word: mnemonicWord }))
|
||||||
newValidWords[i] = generatedMnemonic[i] === mnemonicWord
|
newValidWords[i] = generatedMnemonic[i] === mnemonicWord
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user