Browse Source

remove getConfig

itizawa 6 years ago
parent
commit
01272ddedb

+ 1 - 10
src/client/js/components/Admin/Customize/CustomizeHeaderSetting.jsx

@@ -20,18 +20,9 @@ class CustomizeHeaderSetting extends React.Component {
   constructor(props) {
   constructor(props) {
     super(props);
     super(props);
 
 
-    this.state = {
-      editorInputValue: '',
-    };
-
     this.onClickSubmit = this.onClickSubmit.bind(this);
     this.onClickSubmit = this.onClickSubmit.bind(this);
   }
   }
 
 
-  componentDidMount() {
-    const { customizeHeader } = this.props.appContainer.getConfig();
-    this.setState({ editorInputValue: customizeHeader || '' });
-  }
-
   async onClickSubmit() {
   async onClickSubmit() {
     const { t, adminCustomizeContainer } = this.props;
     const { t, adminCustomizeContainer } = this.props;
 
 
@@ -69,7 +60,7 @@ class CustomizeHeaderSetting extends React.Component {
         <div className="col-xs-12">
         <div className="col-xs-12">
           <CustomHeaderEditor
           <CustomHeaderEditor
             // The value passed must be immutable
             // The value passed must be immutable
-            value={this.state.editorInputValue}
+            defaultValue={adminCustomizeContainer.state.currentCustomizeHeader}
             onChange={(inputValue) => { adminCustomizeContainer.changeCustomizeHeader(inputValue) }}
             onChange={(inputValue) => { adminCustomizeContainer.changeCustomizeHeader(inputValue) }}
           />
           />
         </div>
         </div>