From bf78ca0e8f6ccb61427a12e4db4fe8dbbbcee3d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 6 Jul 2022 10:44:30 +0200 Subject: [PATCH] MOBILE-4047 user: Get user basic info from siteInfo as fallback --- .../features/mainmenu/components/user-menu/user-menu.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/features/mainmenu/components/user-menu/user-menu.ts b/src/core/features/mainmenu/components/user-menu/user-menu.ts index c20d16bce..4b02fa22e 100644 --- a/src/core/features/mainmenu/components/user-menu/user-menu.ts +++ b/src/core/features/mainmenu/components/user-menu/user-menu.ts @@ -71,7 +71,14 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy { // Load the handlers. if (this.siteInfo) { - this.user = await CoreUser.getProfile(this.siteInfo.userid); + try { + this.user = await CoreUser.getProfile(this.siteInfo.userid); + } catch { + this.user = { + id: this.siteInfo.userid, + fullname: this.siteInfo.fullname, + }; + } this.subscription = CoreUserDelegate.getProfileHandlersFor(this.user, CoreUserDelegateContext.USER_MENU) .subscribe((handlers) => {