From e14c8c5e915dc050285418a4493de746ff5f8a8a Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 31 Aug 2021 12:03:59 -0400 Subject: [PATCH] Lint --- client/homebrew/editor/editor.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index f65c47a23..9f6ca5e27 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -68,10 +68,9 @@ const Editor = createClass({ }, handleInject : function(injectText){ - const text = ( - this.isText() ? this.props.brew.text : - this.isStyle() ? this.props.brew.style ?? DEFAULT_STYLE_TEXT : '' - ); + let text; + if(this.isText()) text = this.props.brew.text; + if(this.isStyle()) text = this.props.brew.style ?? DEFAULT_STYLE_TEXT; const lines = text.split('\n'); const cursorPos = this.refs.codeEditor.getCursorPosition(); @@ -79,7 +78,7 @@ const Editor = createClass({ this.refs.codeEditor.setCursorPosition(cursorPos.line + injectText.split('\n').length, cursorPos.ch + injectText.length); - if(this.isText()) this.props.onTextChange(lines.join('\n')); + if(this.isText()) this.props.onTextChange(lines.join('\n')); if(this.isStyle()) this.props.onStyleChange(lines.join('\n')); },