on master help sign in
activate-ux: restore passport download

Accidentally removed this during a judicious late night refactor. It's back now!

commite2498e9a2c1a4696ad6d7844284e348cfe7f0fcf authortomholford <tomholford@users.noreply.github.com> dateThu 16 Dec 2021, 17:10 (5 years ago) parentf3fddfe
1 file changed+6−1
src/views/Activate/MasterKeyDownload.tsx+6−1
src/views/Activate/MasterKeyDownload.tsx+6−1
@@ -18,6 +18,7 @@ import { DEFAULT_FADE_TIMEOUT, MASTER_KEY_DURATION } from 'lib/constants';
1818import { timeout } from 'lib/timeout';
1919import View from 'components/View';
2020import useMultikeyFileGenerator from 'lib/useMultikeyFileGenerator';
21+import { downloadWallet } from 'lib/invite';
2122
2223const MasterKeyDownload = () => {
2324 const {
@@ -45,7 +46,7 @@ const MasterKeyDownload = () => {
4546 Just: p => p.value.toFixed(),
4647 });
4748
48− const { download } = useMultikeyFileGenerator({
49+ const { keyfile, filename } = useMultikeyFileGenerator({
4950 point,
5051 seedWallet: inviteWallet,
5152 });
@@ -62,6 +63,10 @@ const MasterKeyDownload = () => {
6263 [paper, setGenerated]
6364 );
6465
66+ const download = useCallback(async () => {
67+ await downloadWallet(paper.getOrElse([]), keyfile, filename);
68+ }, [paper, keyfile, filename]);
69+
6570 const onDownloadClick = useCallback(async () => {
6671 await download();
6772 setIsIn(false);