restore comments controls in last comments

This commit is contained in:
Vyrtsev Mikhail
2019-01-17 04:14:06 +03:00
parent e42110a3ba
commit 00bf148630
@@ -2,6 +2,7 @@
import { h, Component } from 'preact';
import { connect } from 'preact-redux';
import store from 'common/store';
import api from 'common/api';
import LastCommentsList from './last-comments-list';
import Avatar from 'components/avatar-icon';
@@ -21,6 +22,11 @@ class UserInfo extends Component {
if (!comments && !isLoading) {
fetchComments(id);
api
.getUser()
.then(data => store.set('user', data))
.catch(() => store.set('user', {}));
api
.getUserComments({ user: id, limit: 10 })
.then(({ comments }) => completeFetchComments(id, comments))