Просмотр исходного кода

change method to be called in tag label

yuto-oweseek 4 лет назад
Родитель
Сommit
be353197c1
1 измененных файлов с 1 добавлено и 7 удалено
  1. 1 7
      packages/app/src/components/Page/TagLabels.jsx

+ 1 - 7
packages/app/src/components/Page/TagLabels.jsx

@@ -54,23 +54,17 @@ class TagLabels extends React.Component {
     if (editorMode === 'edit') {
     if (editorMode === 'edit') {
       return editorContainer.setState({ tags: newTags });
       return editorContainer.setState({ tags: newTags });
     }
     }
-    let page;
     try {
     try {
       const { tags, savedPage } = await appContainer.apiPost('/tags.update', {
       const { tags, savedPage } = await appContainer.apiPost('/tags.update', {
         pageId, tags: newTags, revisionId,
         pageId, tags: newTags, revisionId,
       });
       });
-      page = savedPage;
-      // update pageContainer.state
-      pageContainer.setState({ tags });
-      // update editorContainer.state
       editorContainer.setState({ tags });
       editorContainer.setState({ tags });
-
+      pageContainer.updateStateAfterSave(savedPage, tags, savedPage.revision);
       toastSuccess('updated tags successfully');
       toastSuccess('updated tags successfully');
     }
     }
     catch (err) {
     catch (err) {
       toastError(err, 'fail to update tags');
       toastError(err, 'fail to update tags');
     }
     }
-    pageContainer.updateStateAfterTagAdded(page);
   }
   }