Skip to content

Commit

Permalink
Identity Provider: provide response to aragonAPI when user cancels id…
Browse files Browse the repository at this point in the history
…entity modification (#686)

Coupled with aragon/aragon.js#277, apps will now receive errors on `requestAddressIdentityModification()`.
  • Loading branch information
sohkai authored Apr 10, 2019
1 parent 9334b19 commit 037a05f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,18 @@ class App extends React.Component {
}

handleIdentityCancel = () => {
const { identityIntent } = this.state

identityIntent.reject(new Error('Identity modification cancelled'))
this.setState({ identityIntent: null })
}

handleIdentitySave = ({ address, label }) => {
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)
}

Expand Down

0 comments on commit 037a05f

Please sign in to comment.