From d8bf628e5c2b3ede682285fa7ee63118998a6121 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Tue, 9 Apr 2019 20:01:35 +0200 Subject: [PATCH] Identity Provider: provide response to aragonAPI when user cancels identity modification --- src/App.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index 211913634..add2ac2c8 100644 --- a/src/App.js +++ b/src/App.js @@ -280,6 +280,9 @@ class App extends React.Component { } handleIdentityCancel = () => { + const { identityIntent } = this.state + + identityIntent.reject(new Error('Identity modification cancelled')) this.setState({ identityIntent: null }) } @@ -287,9 +290,8 @@ class App extends React.Component { const { identityIntent } = this.state this.state.wrapper .modifyAddressIdentity(address, { name: label }) - .then(() => - this.setState({ identityIntent: null }, identityIntent.resolve) - ) + .then(identityIntent.resolve) + .then(() => this.setState({ identityIntent: null })) .catch(identityIntent.reject) }