mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 03:42:38 +00:00
Handle brew.style being undefined when inject snippets.
This commit is contained in:
@@ -68,7 +68,10 @@ const Editor = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleInject : function(injectText){
|
handleInject : function(injectText){
|
||||||
const text = (this.isText() ? this.props.brew.text : this.props.brew.style);
|
const text = (
|
||||||
|
this.isText() && this.props.brew.text ||
|
||||||
|
this.isStyle() && (this.props.brew.style || DEFAULT_STYLE_TEXT)
|
||||||
|
);
|
||||||
|
|
||||||
const lines = text.split('\n');
|
const lines = text.split('\n');
|
||||||
const cursorPos = this.refs.codeEditor.getCursorPosition();
|
const cursorPos = this.refs.codeEditor.getCursorPosition();
|
||||||
|
|||||||
Reference in New Issue
Block a user