Selaa lähdekoodia

exec init draft

yusuketk 5 vuotta sitten
vanhempi
sitoutus
b51352b809

+ 2 - 0
src/client/js/components/MyDraftList/MyDraftList.jsx

@@ -17,6 +17,8 @@ class MyDraftList extends React.Component {
   constructor(props) {
     super(props);
 
+    this.props.editorContainer.initDrafts();
+
     this.state = {
       drafts: [],
       currentDrafts: [],

+ 6 - 4
src/client/js/services/EditorContainer.js

@@ -90,10 +90,12 @@ export default class EditorContainer extends Container {
       }
     }
 
-    if (this.state.pageId == null) {
-      const draft = this.findDraft(this.state.path);
-      if (draft != null) {
-        this.state.markdown = draft;
+    if (this.state !== undefined) {
+      if (this.state.pageId == null) {
+        const draft = this.findDraft(this.state.path);
+        if (draft != null) {
+          this.state.markdown = draft;
+        }
       }
     }
   }