From 97ec5053f00508cd37b9d8a1172ee2c64942b289 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 23 Nov 2016 22:17:36 +0100 Subject: [PATCH] PR grumbles, wording, isRequired, no close on error --- js/src/modals/DeleteAccount/deleteAccount.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/js/src/modals/DeleteAccount/deleteAccount.js b/js/src/modals/DeleteAccount/deleteAccount.js index 1c6f48df5..f3bd880c1 100644 --- a/js/src/modals/DeleteAccount/deleteAccount.js +++ b/js/src/modals/DeleteAccount/deleteAccount.js @@ -31,8 +31,8 @@ class DeleteAccount extends Component { static propTypes = { account: PropTypes.object.isRequired, - onClose: PropTypes.func, - newError: PropTypes.func + onClose: PropTypes.func.isRequired, + newError: PropTypes.func.isRequired } state = { @@ -51,7 +51,7 @@ class DeleteAccount extends Component { onDeny={ this.closeDeleteDialog } onConfirm={ this.onDeleteConfirmed }>
- Are you sure you want to remove permanently delete the following account? + Are you sure you want to permanently delete the following account?
{ if (result === true) { router.push('/accounts'); + this.closeDeleteDialog(); } else { newError(new Error('Deletion failed.')); } - - this.closeDeleteDialog(); }) .catch((error) => { console.error('onDeleteConfirmed', error); newError(new Error(`Deletion failed: ${error.message}`)); - this.closeDeleteDialog(); }); }