Skip to content

Commit

Permalink
Merge pull request #125 from josemigallas/AEROGEAR-7834
Browse files Browse the repository at this point in the history
Prevent selecting same resolver twice
  • Loading branch information
josemigallas authored Sep 5, 2018
2 parents a198f8e + 7108bc8 commit fc4c010
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ui/components/resolvers/ResolversContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@ class ResolversContainer extends Component {
return [];
}

onResolverClicked(resolver) {
const { isResolverSaved } = this.state;
onResolverClicked(clickedResolver) {
const { resolver, isResolverSaved } = this.state;

if (resolver !== null
&& resolver.type === clickedResolver.type
&& resolver.field === clickedResolver.field) {
return;
}

if (isResolverSaved) {
this.setState({ resolver });
this.setState({ resolver: clickedResolver });
} else {
this.setState({ showChangeConfirmation: true, clickedResolver: resolver });
this.setState({ showChangeConfirmation: true, clickedResolver });
}
}

Expand Down

0 comments on commit fc4c010

Please sign in to comment.