Skip to content

Commit

Permalink
checks if clicked resolver is the same in detail
Browse files Browse the repository at this point in the history
  • Loading branch information
josemigallas committed Sep 5, 2018
1 parent a198f8e commit 7108bc8
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 7108bc8

Please sign in to comment.