mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
Separate bundled setState calls
This commit is contained in:
@@ -62,20 +62,17 @@ const Snippetbar = createClass({
|
||||
},
|
||||
|
||||
componentDidUpdate : async function(prevProps) {
|
||||
const update = {};
|
||||
let newData = false;
|
||||
|
||||
if(prevProps.renderer != this.props.renderer || prevProps.theme != this.props.theme || prevProps.snippetBundle != this.props.snippetBundle) {
|
||||
update.snippets = this.compileSnippets();
|
||||
newData = true;
|
||||
this.setState({
|
||||
snippets : this.compileSnippets()
|
||||
});
|
||||
};
|
||||
|
||||
if(historyExists(this.props.brew) != this.state.historyExists){
|
||||
update.historyExists = !this.state.historyExists;
|
||||
newData = true;
|
||||
}
|
||||
|
||||
newData && this.setState(update);
|
||||
this.setState({
|
||||
historyExists : !this.state.historyExists
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
mergeCustomizer : function(oldValue, newValue, key) {
|
||||
|
||||
Reference in New Issue
Block a user