Add error catching when loading home screen tab
This commit is contained in:
parent
891c63a3da
commit
c0228cc176
1 changed files with 6 additions and 4 deletions
|
@ -29,15 +29,17 @@ class HomeTab {
|
||||||
const apiClient = this.apiClient;
|
const apiClient = this.apiClient;
|
||||||
this.destroyHomeSections();
|
this.destroyHomeSections();
|
||||||
this.sectionsRendered = true;
|
this.sectionsRendered = true;
|
||||||
return apiClient.getCurrentUser().then(function (user) {
|
return apiClient.getCurrentUser()
|
||||||
return homeSections.loadSections(view.querySelector('.sections'), apiClient, user, userSettings).then(function () {
|
.then(user => homeSections.loadSections(view.querySelector('.sections'), apiClient, user, userSettings))
|
||||||
|
.then(() => {
|
||||||
if (options.autoFocus) {
|
if (options.autoFocus) {
|
||||||
focusManager.autoFocus(view);
|
focusManager.autoFocus(view);
|
||||||
}
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
console.error(err);
|
||||||
|
}).finally(() => {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
onPause() {
|
onPause() {
|
||||||
const sectionsContainer = this.sectionsContainer;
|
const sectionsContainer = this.sectionsContainer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue