diff --git a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.html b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.html index 1d9f61bde..998f7e7c0 100644 --- a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.html +++ b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.html @@ -1,9 +1,3 @@ - \ No newline at end of file + + diff --git a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts index c1acf9857..d95001748 100644 --- a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts +++ b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts @@ -12,8 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { CoreSiteInfo } from '@classes/site'; +import { IonRouterOutlet } from '@ionic/angular'; import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreMainMenuUserMenuComponent } from '../user-menu/user-menu'; @@ -27,17 +28,24 @@ import { CoreMainMenuUserMenuComponent } from '../user-menu/user-menu'; selector: 'core-user-menu-button', templateUrl: 'user-menu-button.html', }) -export class CoreMainMenuUserButtonComponent { +export class CoreMainMenuUserButtonComponent implements OnInit { siteInfo?: CoreSiteInfo; + isMainScreen = false; - constructor() { + constructor(protected routerOutlet: IonRouterOutlet) { const currentSite = CoreSites.getRequiredCurrentSite(); - // @TODO: Check if the page where I currently am is at level 0. this.siteInfo = currentSite.getInfo(); } + /** + * @inheritdoc + */ + ngOnInit(): void { + this.isMainScreen = !this.routerOutlet.canGoBack(); + } + /** * Open User menu *