itizawa 6 лет назад
Родитель
Сommit
9df7cd5d30
1 измененных файлов с 0 добавлено и 21 удалено
  1. 0 21
      src/client/js/components/LikeButton.jsx

+ 0 - 21
src/client/js/components/LikeButton.jsx

@@ -17,27 +17,6 @@ class LikeButton extends React.Component {
     this.handleClick = this.handleClick.bind(this);
   }
 
-  async componentDidMount() {
-    // if guest user
-    if (!this.isUserLoggedIn()) {
-      // do nothing
-      return;
-    }
-
-    const { appContainer, pageId } = this.props;
-
-    try {
-      const res = await appContainer.apiGet('/bookmarks.get', { page_id: pageId });
-      console.log(res);
-      if (res.bookmark) {
-        this.setState({ isLiked: true });
-      }
-    }
-    catch (err) {
-      toastError(err);
-    }
-  }
-
   async handleClick() {
     const { appContainer, pageId } = this.props;
     const { isLiked } = this.state;