0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Move state change to handleViewChange

This commit is contained in:
G.Ambatte
2022-05-29 16:16:48 +12:00
parent ab8dd8ae76
commit 4cc3dd93e2

View File

@@ -96,6 +96,7 @@ const Editor = createClass({
},
handleViewChange : function(newView){
this.props.setMoveArrows(newView === 'text');
this.setState({
view : newView
}, this.updateEditorSize); //TODO: not sure if updateeditorsize needed
@@ -232,7 +233,6 @@ const Editor = createClass({
renderEditor : function(){
if(this.isText()){
this.props.setMoveArrows(true);
return <>
<CodeEditor key='codeEditor'
ref='codeEditor'
@@ -244,7 +244,6 @@ const Editor = createClass({
</>;
}
if(this.isStyle()){
this.props.setMoveArrows(false);
return <>
<CodeEditor key='codeEditor'
ref='codeEditor'
@@ -257,7 +256,6 @@ const Editor = createClass({
</>;
}
if(this.isMeta()){
this.props.setMoveArrows(false);
return <>
<CodeEditor key='codeEditor'
view={this.state.view}