change logic of preloaders on init load

This commit is contained in:
igoradamenko
2018-05-12 15:07:26 +03:00
parent 343a67f975
commit 0303823205
+1 -6
View File
@@ -57,17 +57,12 @@ export default class Root extends Component {
.then(data => store.set('user', data))
.catch(() => store.set('user', {}))
.finally(() => {
this.setState({
isLoaded: true,
isCommentsListLoading: true,
});
api.find({ sort, url })
.then(({ comments = [] } = {}) => store.set('comments', comments))
.catch(() => store.set('comments', []))
.finally(() => {
this.setState({
isCommentsListLoading: false,
isLoaded: true,
user: store.get('user'),
});