Add mnemonic download setup requirement (#269)
This commit is contained in:
parent
63dc54eaf4
commit
958cf5df7a
|
@ -99,9 +99,19 @@ function CreateWalletForm() {
|
||||||
|
|
||||||
function SeedWordsForm({ mnemonicAndSeed, goForward }) {
|
function SeedWordsForm({ mnemonicAndSeed, goForward }) {
|
||||||
const [confirmed, setConfirmed] = useState(false);
|
const [confirmed, setConfirmed] = useState(false);
|
||||||
|
const [downloaded, setDownloaded] = useState(false);
|
||||||
const [showDialog, setShowDialog] = useState(false);
|
const [showDialog, setShowDialog] = useState(false);
|
||||||
const [seedCheck, setSeedCheck] = useState('');
|
const [seedCheck, setSeedCheck] = useState('');
|
||||||
|
|
||||||
|
const downloadMnemonic = (mnemonic) => {
|
||||||
|
const url = window.URL.createObjectURL(new Blob([mnemonic]));
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.setAttribute('download', 'sollet.bak');
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Card>
|
<Card>
|
||||||
|
@ -149,9 +159,17 @@ function SeedWordsForm({ mnemonicAndSeed, goForward }) {
|
||||||
}
|
}
|
||||||
label="I have saved these words in a safe place."
|
label="I have saved these words in a safe place."
|
||||||
/>
|
/>
|
||||||
|
<Typography paragraph>
|
||||||
|
<Button variant="contained" color="primary" onClick={() => {
|
||||||
|
downloadMnemonic(mnemonicAndSeed?.mnemonic);
|
||||||
|
setDownloaded(true);
|
||||||
|
}}>
|
||||||
|
Download Backup Mnemonic File (Required)
|
||||||
|
</Button>
|
||||||
|
</Typography>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardActions style={{ justifyContent: 'flex-end' }}>
|
<CardActions style={{ justifyContent: 'flex-end' }}>
|
||||||
<Button color="primary" disabled={!confirmed} onClick={() => setShowDialog(true)}>
|
<Button color="primary" disabled={!confirmed || !downloaded} onClick={() => setShowDialog(true)}>
|
||||||
Continue
|
Continue
|
||||||
</Button>
|
</Button>
|
||||||
</CardActions>
|
</CardActions>
|
||||||
|
|
Loading…
Reference in New Issue