// @flow import React, { Component } from 'react'; import PropTypes from 'prop-types'; import translate from 'translations'; import type PrivKeyWallet from 'libs/wallet/privkey'; import { makeBlob } from 'utils/blob'; import { getV3Filename } from 'libs/keystore'; type Props = { wallet: PrivKeyWallet, password: string, hasDownloadedWalletFile: boolean, downloadUTCGenerateWallet: () => any, confirmContinueToPaperGenerateWallet: () => any }; export default class DownloadWallet extends Component { props: Props; keystore: Object; static propTypes = { // Store state wallet: PropTypes.object.isRequired, password: PropTypes.string.isRequired, hasDownloadedWalletFile: PropTypes.bool, // Actions downloadUTCGenerateWallet: PropTypes.func, confirmContinueToPaperGenerateWallet: PropTypes.func }; componentWillMount() { this.keystore = this.props.wallet.toKeystore(this.props.password); } componentWillUpdate(nextProps: Props) { if (this.props.wallet !== nextProps.wallet) { this.keystore = nextProps.wallet.toKeystore(nextProps.password); } } render() { const { hasDownloadedWalletFile, downloadUTCGenerateWallet, confirmContinueToPaperGenerateWallet } = this.props; return (