yusuketk пре 7 година
родитељ
комит
41e3163cbf
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      src/client/js/components/Page/TagLabel.jsx

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

@@ -53,18 +53,18 @@ class TagLabel extends React.Component {
 
 
     if (isPageEditor) { // set tag on draft on edit
     if (isPageEditor) { // set tag on draft on edit
       this.props.sendTagData(this.state.newPageTags);
       this.props.sendTagData(this.state.newPageTags);
-      this.setState({ currentPageTags: this.state.newPageTags, isOpenModal: false });
     }
     }
     else { // update tags without saving the page on view
     else { // update tags without saving the page on view
       try {
       try {
         await this.props.crowi.apiPost('/tags.update', { pageId: this.props.pageId, tags: this.state.newPageTags });
         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) {
       catch (err) {
         this.apiErrorHandler(err);
         this.apiErrorHandler(err);
+        return;
       }
       }
-      this.apiSuccessHandler();
     }
     }
+    this.setState({ currentPageTags: this.state.newPageTags, isOpenModal: false });
   }
   }
 
 
   apiSuccessHandler() {
   apiSuccessHandler() {