From c0228cc176e4f0ba03486f5d15c63ef9898d34cd Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Mon, 4 Apr 2022 14:42:03 -0400 Subject: [PATCH] Add error catching when loading home screen tab --- src/controllers/hometab.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/controllers/hometab.js b/src/controllers/hometab.js index feb31fedc3..9b5c087076 100644 --- a/src/controllers/hometab.js +++ b/src/controllers/hometab.js @@ -29,15 +29,17 @@ class HomeTab { const apiClient = this.apiClient; this.destroyHomeSections(); this.sectionsRendered = true; - return apiClient.getCurrentUser().then(function (user) { - return homeSections.loadSections(view.querySelector('.sections'), apiClient, user, userSettings).then(function () { + return apiClient.getCurrentUser() + .then(user => homeSections.loadSections(view.querySelector('.sections'), apiClient, user, userSettings)) + .then(() => { if (options.autoFocus) { focusManager.autoFocus(view); } - + }).catch(err => { + console.error(err); + }).finally(() => { loading.hide(); }); - }); } onPause() { const sectionsContainer = this.sectionsContainer;