Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/routes/Recovery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function Recovery() {
validateAddress(walletAddress)
}, [wallet])

useEffect(() => {
setWarningVisible(false)
}, [mnemonic])

useEffect(() => {
setIsNetworkModalOpen(isNetworkModalOpenObservable)
}, [isNetworkModalOpenObservable])
Expand All @@ -80,7 +84,7 @@ function Recovery() {
}

const validMnemonic = (testMnemonic: string = mnemonic) => {
return testMnemonic.trim().split(/\s+/g).length == 12
return testMnemonic.trim().split(/\s+/g).length == 12 || testMnemonic.trim().split(/\s+/g).length == 24
}

const validPassword = () => {
Expand Down Expand Up @@ -111,6 +115,11 @@ function Recovery() {
...(WALLETS[signer.address] ?? []).map(({ wallet }) => wallet)
]

if (wallets.length === 0) {
setWarningVisible(true)
throw new Error('No wallets found, try again in 10 minutes.')
}

setPossibleWallets(wallets)

if (wallets) {
Expand Down Expand Up @@ -187,7 +196,7 @@ function Recovery() {
</Text>

<Text variant="normal" fontWeight="medium" color="text50" marginBottom="1">
Paste your 12-word mnemonic, with each word separated by a space.
Paste your 12 or 24-word mnemonic, with each word separated by a space.
</Text>

<TextInput
Expand All @@ -199,7 +208,7 @@ function Recovery() {

{mnemonic && !validMnemonic() && (
<Text variant="small" color="negative" marginLeft="1" marginTop="2">
Mnemonic must be 12 words
Mnemonic must be 12 or 24 words
</Text>
)}
</Box>
Expand Down