Skip to content

Commit

Permalink
refactor: use forEach instead of map in handleFeatureSelect (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
stew-ro authored May 14, 2020
1 parent f953acd commit c1c590c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/react/components/pages/editorPage/canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,12 @@ export default class Canvas extends React.Component<ICanvasProps, ICanvasState>
if (category === FeatureCategory.Checkbox ||
(category === FeatureCategory.Label && this.state.currentAsset.regions
.find((r) => r.id === regionId).category === FeatureCategory.Checkbox)) {
selectedRegions.map((region) => this.removeFromSelectedRegions(region.id));
selectedRegions.forEach((region) => this.removeFromSelectedRegions(region.id));
} else if (category === FeatureCategory.Text ||
(category === FeatureCategory.Label && this.state.currentAsset.regions
.find((r) => r.id === regionId).category === FeatureCategory.Text)) {
selectedRegions.filter((region) => region.category === FeatureCategory.Checkbox)
.map((region) => this.removeFromSelectedRegions(region.id));
.forEach((region) => this.removeFromSelectedRegions(region.id));
}
}

Expand Down

0 comments on commit c1c590c

Please sign in to comment.