yusuketk 7 éve
szülő
commit
9144857d7f
1 módosított fájl, 4 hozzáadás és 3 törlés
  1. 4 3
      src/client/js/components/Page/TagLabel.jsx

+ 4 - 3
src/client/js/components/Page/TagLabel.jsx

@@ -50,19 +50,20 @@ class TagLabel extends React.Component {
   async handleSubmit() {
     // eslint-disable-next-line no-restricted-globals
     const isPageEditor = location.href.slice(-5) === '#edit';
-    if (isPageEditor) {
+
+    if (isPageEditor) { // set tag on draft on efit
       this.props.sendTagData(this.state.newPageTags);
       this.setState({ currentPageTags: this.state.newPageTags, isOpenModal: false });
     }
-    else {
+    else { // update tags without saving the page on view
       try {
         await this.props.crowi.apiPost('/tags.update', { pageId: this.props.pageId, tags: this.state.newPageTags });
         this.setState({ currentPageTags: this.state.newPageTags, isOpenModal: false });
-        this.apiSuccessHandler();
       }
       catch (err) {
         this.apiErrorHandler(err);
       }
+      this.apiSuccessHandler();
     }
   }