Skip to content

Commit

Permalink
ColorPalette - fix orientation change called unnecessarily (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
M-i-k-e-l committed Apr 2, 2020
1 parent 6341c5e commit e8cd4a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/colorPicker/ColorPalette.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ export default class ColorPalette extends PureBaseComponent {
}

onOrientationChanged = () => {
this.initLocalVariables();
this.setState({orientation: Constants.orientation}); // only to trigger render
if (this.state.orientation !== Constants.orientation) {
this.initLocalVariables();
this.setState({orientation: Constants.orientation}); // only to trigger render
}
}

initLocalVariables() {
Expand Down

0 comments on commit e8cd4a2

Please sign in to comment.