From 48728af43ad746d70ef3e251dc28b75028dea1e6 Mon Sep 17 00:00:00 2001
From: Clemens <cle1000.cb@gmail.com>
Date: Tue, 19 Jul 2016 12:23:20 +0200
Subject: moved flow editor state to redux

---
 web/src/js/components/common/CodeEditor.jsx | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'web/src/js/components/common/CodeEditor.jsx')

diff --git a/web/src/js/components/common/CodeEditor.jsx b/web/src/js/components/common/CodeEditor.jsx
index c122cf94..5b2305a8 100644
--- a/web/src/js/components/common/CodeEditor.jsx
+++ b/web/src/js/components/common/CodeEditor.jsx
@@ -5,17 +5,25 @@ import Codemirror from 'react-codemirror';
 
 export default class CodeEditor extends Component{
      static propTypes = {
-        value: PropTypes.string.isRequired,
+        content: PropTypes.string.isRequired,
         onChange: PropTypes.func.isRequired,
     }
 
+    constructor(props){
+        super(props)
+    }
+
+    componentWillMount(){
+        this.props.onChange(this.props.content)
+    }
+
     render() {
         let options = {
             lineNumbers: true
         };
         return (
             <div onKeyDown={e => e.stopPropagation()}>
-                <Codemirror value={this.props.value} onChange={this.props.onChange} options={options}/>
+                <Codemirror value={this.props.content} onChange={this.props.onChange} options={options}/>
             </div>
         )
     }
-- 
cgit v1.2.3

