diff --git a/src/components/steps/MnemonicScreen.tsx b/src/components/steps/MnemonicScreen.tsx index 9d2a51b..d396e09 100644 --- a/src/components/steps/MnemonicScreen.tsx +++ b/src/components/steps/MnemonicScreen.tsx @@ -29,6 +29,7 @@ const MnemonicScreen: FC = props => { const [isValid, setIsValid] = useState(false); const [step, setStep] = useState(LoadMnemonicSteps.Home); const [currentIndex, setCurrentIndex] = useState(0); + const [selectedWords, setSelectedWords] = useState(Array(12).fill(false) as boolean[]) const shuffledWords = useRef([] as string[]); const verifyIndexes = useRef([] as number[]); @@ -75,6 +76,7 @@ const MnemonicScreen: FC = props => { } const confirmMnemonic = () => { + setSelectedWords(Array(12).fill(false)); shuffle(shuffledWords.current); verifyIndexes.current = [...Array(12).keys()]; setCurrentIndex(0); @@ -112,6 +114,10 @@ const MnemonicScreen: FC = props => { } if (shuffledWords.current[selected] == wordAt(verifyIndexes.current[currentIndex])) { + var tmp = [...selectedWords]; + tmp[selected] = true; + setSelectedWords(tmp); + if (currentIndex == 2) { setIsValid(true); } @@ -219,9 +225,9 @@ const MnemonicScreen: FC = props => { numColumns={3} style={[styles.mnemonicList, {marginTop: 10}]} renderItem={({ item, index }) => - + verifyWord(index)}> - {item} + {item} }