2019-08-20 14:29:59 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import { Modal } from 'modal/modal';
|
2019-09-26 18:28:08 +02:00
|
|
|
import { deleteSavedPassword } from 'util/saved-passwords';
|
2019-08-20 14:29:59 +02:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
closeModal: () => void,
|
2019-09-26 18:28:08 +02:00
|
|
|
callback?: () => void,
|
2019-08-20 14:29:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class ModalPasswordUnsave extends React.PureComponent<Props> {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
isOpen
|
|
|
|
contentLabel={__('Unsave Password')}
|
2020-08-26 22:28:33 +02:00
|
|
|
title={__('Clear saved password')}
|
2019-08-20 14:29:59 +02:00
|
|
|
type="confirm"
|
|
|
|
confirmButtonLabel={__('Forget')}
|
|
|
|
abortButtonLabel={__('Nevermind')}
|
2019-08-28 04:35:07 +02:00
|
|
|
onConfirmed={() =>
|
2019-09-26 18:28:08 +02:00
|
|
|
deleteSavedPassword().then(() => {
|
2019-08-28 04:35:07 +02:00
|
|
|
this.props.closeModal();
|
2019-09-26 18:28:08 +02:00
|
|
|
if (this.props.callback) {
|
|
|
|
this.props.callback();
|
|
|
|
}
|
2019-08-28 04:35:07 +02:00
|
|
|
})
|
2019-08-20 14:29:59 +02:00
|
|
|
}
|
|
|
|
onAborted={this.props.closeModal}
|
|
|
|
>
|
|
|
|
<p>
|
|
|
|
{__('You are about to delete your saved password.')}{' '}
|
|
|
|
{__('Your wallet will still be encrypted, but you will have to remember and enter it manually on startup.')}
|
|
|
|
</p>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ModalPasswordUnsave;
|