From b39cbd338f2bb9e55afc60040fa142bf1370f53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 27 Nov 2018 10:43:31 +0100 Subject: [PATCH] MOBILE-2744 ionic: Fix uncaught promises --- src/addon/remotethemes/providers/remotethemes.ts | 4 +++- src/addon/remotethemes/remotethemes.module.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/addon/remotethemes/providers/remotethemes.ts b/src/addon/remotethemes/providers/remotethemes.ts index ceebbf659..f0555d656 100644 --- a/src/addon/remotethemes/providers/remotethemes.ts +++ b/src/addon/remotethemes/providers/remotethemes.ts @@ -61,7 +61,9 @@ export class AddonRemoteThemesProvider { hash: '' }; - return this.load(siteId, true); + return this.load(siteId, true).catch((error) => { + this.logger.error('Error loading site after site init', error); + }); } /** diff --git a/src/addon/remotethemes/remotethemes.module.ts b/src/addon/remotethemes/remotethemes.module.ts index 72475434b..4330cc9a8 100644 --- a/src/addon/remotethemes/remotethemes.module.ts +++ b/src/addon/remotethemes/remotethemes.module.ts @@ -102,7 +102,9 @@ export class AddonRemoteThemesModule { // Load temporary styles when site config is checked in login. eventsProvider.on(CoreEventsProvider.LOGIN_SITE_CHECKED, (data) => { - remoteThemesProvider.loadTmpStyles(data.config.mobilecssurl); + remoteThemesProvider.loadTmpStyles(data.config.mobilecssurl).catch((error) => { + logger.error('Error loading tmp styles', error); + }); }); // Unload temporary styles when site config is "unchecked" in login.