itizawa 6 лет назад
Родитель
Сommit
01272ddedb
1 измененных файлов с 1 добавлено и 10 удалено
  1. 1 10
      src/client/js/components/Admin/Customize/CustomizeHeaderSetting.jsx

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

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