0
0
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:
G.Ambatte
2024-09-16 19:40:11 +12:00
parent 8315df33ae
commit 8ceb422156

View File

@@ -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) {