Skip to content

Commit

Permalink
Merge pull request #4256 from crazyserver/MOBILE-4653
Browse files Browse the repository at this point in the history
MOBILE-4653 core: Remove and protect unused code
  • Loading branch information
dpalou authored Dec 10, 2024
2 parents d9a64ff + 72c7e05 commit 847af5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/core/features/mainmenu/components/user-menu/user-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ import { CoreSiteLogoComponent } from '@/core/components/site-logo/site-logo';
})
export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {

siteId?: string;
siteInfo?: CoreSiteInfo;
siteName?: string;
siteUrl?: string;
displaySiteUrl = false;
handlers: CoreUserProfileHandlerData[] = [];
Expand All @@ -63,6 +61,8 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
displayContactSupport = false;
removeAccountOnLogout = false;

protected siteId?: string;
protected siteName?: string;
protected subscription!: Subscription;

/**
Expand Down
17 changes: 1 addition & 16 deletions src/core/features/mainmenu/pages/home/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
import { Subscription } from 'rxjs';

import { CoreSites } from '@services/sites';
import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreEventObserver } from '@singletons/events';
import { CoreTabsOutletComponent, CoreTabsOutletTab } from '@components/tabs-outlet/tabs-outlet';
import { CoreMainMenuHomeDelegate, CoreMainMenuHomeHandlerToDisplay } from '../../services/home-delegate';
import { CoreArray } from '@singletons/array';
Expand Down Expand Up @@ -44,16 +44,9 @@ export class CoreMainMenuHomePage implements OnInit {
* @inheritdoc
*/
async ngOnInit(): Promise<void> {
await this.loadSiteName();

this.subscription = CoreMainMenuHomeDelegate.getHandlersObservable().subscribe((handlers) => {
handlers && this.initHandlers(handlers);
});

// Refresh the enabled flags if site is updated.
this.updateSiteObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, async () => {
await this.loadSiteName();
}, CoreSites.getCurrentSiteId());
}

/**
Expand Down Expand Up @@ -92,14 +85,6 @@ export class CoreMainMenuHomePage implements OnInit {
}, 50);
}

/**
* Load the site name.
*/
protected async loadSiteName(): Promise<void> {
const site = CoreSites.getRequiredCurrentSite();
this.siteName = await site.getSiteName() || '';
}

/**
* Tab was selected.
*/
Expand Down

0 comments on commit 847af5f

Please sign in to comment.