enhance styles of preloader

This commit is contained in:
igoradamenko
2018-05-18 18:02:08 +03:00
parent b4d35283ae
commit 359ee35bfc
5 changed files with 69 additions and 89 deletions
+20 -18
View File
@@ -51,25 +51,27 @@ export default class Root extends Component {
componentDidMount() {
const { sort } = this.state;
api.getConfig().then(config => {
store.set('config', config);
this.setState({ config });
});
Promise.all([
api.getUser()
.then(data => store.set('user', data))
.catch(() => store.set('user', {})),
api.find({ sort, url })
.then(({ comments = [] } = {}) => store.set('comments', comments))
.catch(() => store.set('comments', [])),
]).finally(() => {
this.setState({
isLoaded: true,
user: store.get('user'),
});
setTimeout(this.checkUrlHash);
})
api.getConfig().then(config => {
store.set('config', config);
this.setState({ config });
});
Promise.all([
api.getUser()
.then(data => store.set('user', data))
.catch(() => store.set('user', {})),
api.find({ sort, url })
.then(({ comments = [] } = {}) => store.set('comments', comments))
.catch(() => store.set('comments', [])),
]).finally(() => {
this.setState({
isLoaded: true,
user: store.get('user'),
});
setTimeout(this.checkUrlHash);
});
}
checkUrlHash() {