Merge pull request #4256 from crazyserver/MOBILE-4653
MOBILE-4653 core: Remove and protect unused codemain
commit
847af5f4b0
|
@ -50,9 +50,7 @@ import { CoreSiteLogoComponent } from '@/core/components/site-logo/site-logo';
|
||||||
})
|
})
|
||||||
export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
|
export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
siteId?: string;
|
|
||||||
siteInfo?: CoreSiteInfo;
|
siteInfo?: CoreSiteInfo;
|
||||||
siteName?: string;
|
|
||||||
siteUrl?: string;
|
siteUrl?: string;
|
||||||
displaySiteUrl = false;
|
displaySiteUrl = false;
|
||||||
handlers: CoreUserProfileHandlerData[] = [];
|
handlers: CoreUserProfileHandlerData[] = [];
|
||||||
|
@ -63,6 +61,8 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy {
|
||||||
displayContactSupport = false;
|
displayContactSupport = false;
|
||||||
removeAccountOnLogout = false;
|
removeAccountOnLogout = false;
|
||||||
|
|
||||||
|
protected siteId?: string;
|
||||||
|
protected siteName?: string;
|
||||||
protected subscription!: Subscription;
|
protected subscription!: Subscription;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import { CoreSites } from '@services/sites';
|
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 { CoreTabsOutletComponent, CoreTabsOutletTab } from '@components/tabs-outlet/tabs-outlet';
|
||||||
import { CoreMainMenuHomeDelegate, CoreMainMenuHomeHandlerToDisplay } from '../../services/home-delegate';
|
import { CoreMainMenuHomeDelegate, CoreMainMenuHomeHandlerToDisplay } from '../../services/home-delegate';
|
||||||
import { CoreArray } from '@singletons/array';
|
import { CoreArray } from '@singletons/array';
|
||||||
|
@ -44,16 +44,9 @@ export class CoreMainMenuHomePage implements OnInit {
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
async ngOnInit(): Promise<void> {
|
async ngOnInit(): Promise<void> {
|
||||||
await this.loadSiteName();
|
|
||||||
|
|
||||||
this.subscription = CoreMainMenuHomeDelegate.getHandlersObservable().subscribe((handlers) => {
|
this.subscription = CoreMainMenuHomeDelegate.getHandlersObservable().subscribe((handlers) => {
|
||||||
handlers && this.initHandlers(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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,14 +85,6 @@ export class CoreMainMenuHomePage implements OnInit {
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Load the site name.
|
|
||||||
*/
|
|
||||||
protected async loadSiteName(): Promise<void> {
|
|
||||||
const site = CoreSites.getRequiredCurrentSite();
|
|
||||||
this.siteName = await site.getSiteName() || '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tab was selected.
|
* Tab was selected.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue