MOBILE-4047 user: Get user basic info from siteInfo as fallback

main
Pau Ferrer Ocaña 2022-07-06 10:44:30 +02:00
parent cbb1a1ecf5
commit bf78ca0e8f
1 changed files with 8 additions and 1 deletions

View File

@ -71,7 +71,14 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
// Load the handlers.
if (this.siteInfo) {
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) => {