Enable pinning for anon main menu when page tools is enabled

Bug: T331657
Change-Id: I0b79e4f5cef85df489a8a95df75cbe63e62d3b41
This commit is contained in:
Nicholas Ray 2023-03-14 09:26:07 -06:00 committed by Jdlrobson
parent e82d0b002f
commit 1f30146dc6

View file

@ -51,18 +51,17 @@ class VectorComponentMainMenu implements VectorComponent {
$this->localizer = $localizer;
$this->isPinned = $featureManager->isFeatureEnabled( Constants::FEATURE_MAIN_MENU_PINNED );
$isPageToolsEnabled = $featureManager->isFeatureEnabled( Constants::FEATURE_PAGE_TOOLS );
if ( $isPageToolsEnabled ) {
$this->pinnableHeader = new VectorComponentPinnableHeader(
$this->localizer,
$this->isPinned,
self::ID,
'main-menu-pinned'
);
}
if ( $user->isRegistered() ) {
$this->optOut = new VectorComponentMainMenuActionOptOut( $skin );
$isPageToolsEnabled = $featureManager->isFeatureEnabled( Constants::FEATURE_PAGE_TOOLS );
if ( $isPageToolsEnabled ) {
$this->pinnableHeader = new VectorComponentPinnableHeader(
$this->localizer,
$this->isPinned,
self::ID,
'main-menu-pinned'
);
}
}
if ( $shouldLanguageAlertBeInSidebar ) {
$this->alert = new VectorComponentMainMenuActionLanguageSwitchAlert( $skin );