From 83a7636b6f1d09fbe6af607c7d4302e262bd3daa Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 17 Sep 2024 07:41:34 +1200 Subject: [PATCH] Simplify historyExists state logic --- client/homebrew/editor/snippetbar/snippetbar.jsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippetbar.jsx b/client/homebrew/editor/snippetbar/snippetbar.jsx index d94e4fbb4..e19889cc7 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.jsx +++ b/client/homebrew/editor/snippetbar/snippetbar.jsx @@ -68,11 +68,9 @@ const Snippetbar = createClass({ }); }; - if(historyExists(this.props.brew) != this.state.historyExists){ - this.setState({ - historyExists : !this.state.historyExists - }); - }; + this.setState({ + historyExists : historyExists(this.props.brew) + }); }, mergeCustomizer : function(oldValue, newValue, key) {