// @flow import React from 'react'; import { Modal } from 'modal/modal'; import Button from 'component/button'; import { deleteAuthToken } from 'util/saved-passwords'; type Props = { closeModal: () => void, decryptWallet: () => void, updateWalletStatus: () => void, walletDecryptSucceded: boolean, }; type State = { submitted: boolean, }; class ModalWalletDecrypt extends React.PureComponent { state = { submitted: false, // Prior actions could be marked complete }; componentDidUpdate() { const { props, state } = this; if (state.submitted && props.walletDecryptSucceded === true) { deleteAuthToken(); props.closeModal(); props.updateWalletStatus(); } } submitDecryptForm() { this.setState({ submitted: true }); this.props.decryptWallet(); } render() { const { closeModal } = this.props; return ( this.submitDecryptForm()} onAborted={closeModal} >

{__( 'Your wallet has been encrypted with a local password, performing this action will remove this password.' )}{' '}