0
0
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:
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) { 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) {