Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
fix: delegation root node bug when switching identities (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dudleyneedham authored Aug 5, 2020
1 parent b8c1e5f commit 19153b6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/containers/DelegationCreate/DelegationCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,24 @@ class DelegationCreate extends React.Component<Props, State> {
}
this.handleNameChange = this.handleNameChange.bind(this)
this.submit = this.submit.bind(this)
this.setDelegation = this.setDelegation.bind(this)
}

public componentDidMount(): void {
this.setDelegation()
}

public componentDidUpdate(prevProps: Props): void {
const { selectedIdentity } = this.props
if (selectedIdentity !== prevProps.selectedIdentity) {
this.setDelegation()
}
}

public setDelegation(): void {
const { match, selectedIdentity } = this.props
const { cTypeHash } = match.params
const { alias } = this.state

if (selectedIdentity) {
this.setState({
alias,
Expand Down

0 comments on commit 19153b6

Please sign in to comment.