mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 21:22:43 +00:00
Separate bundled setState calls
This commit is contained in:
@@ -62,20 +62,17 @@ const Snippetbar = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidUpdate : async function(prevProps) {
|
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) {
|
if(prevProps.renderer != this.props.renderer || prevProps.theme != this.props.theme || prevProps.snippetBundle != this.props.snippetBundle) {
|
||||||
update.snippets = this.compileSnippets();
|
this.setState({
|
||||||
newData = true;
|
snippets : this.compileSnippets()
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if(historyExists(this.props.brew) != this.state.historyExists){
|
if(historyExists(this.props.brew) != this.state.historyExists){
|
||||||
update.historyExists = !this.state.historyExists;
|
this.setState({
|
||||||
newData = true;
|
historyExists : !this.state.historyExists
|
||||||
}
|
});
|
||||||
|
};
|
||||||
newData && this.setState(update);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mergeCustomizer : function(oldValue, newValue, key) {
|
mergeCustomizer : function(oldValue, newValue, key) {
|
||||||
|
|||||||
Reference in New Issue
Block a user