itizawa 5 lat temu
rodzic
commit
ab68c5fe40
1 zmienionych plików z 3 dodań i 6 usunięć
  1. 3 6
      src/client/js/components/Page/TagLabels.jsx

+ 3 - 6
src/client/js/components/Page/TagLabels.jsx

@@ -44,18 +44,15 @@ class TagLabels extends React.Component {
   }
 
   async tagsUpdatedHandler(tags) {
-    const { appContainer, editorContainer } = this.props;
+    const { appContainer, editorContainer, pageContainer } = this.props;
+    const { pageId } = pageContainer.state;
 
     // only update tags in editorContainer when new page
-    if (editorContainer.state.pageId != null) {
+    if (pageId != null) {
       return editorContainer.setState({ tags });
     }
 
-    // post api request and update tags
-    const { pageContainer } = this.props;
-
     try {
-      const { pageId } = pageContainer.state;
       await appContainer.apiPost('/tags.update', { pageId, tags });
 
       // update pageContainer.state