You are here

public function AccountSwitcherDecorator::switchBack in Acquia Content Hub 8

Switch back only if account stack contains at least one account.

Overrides AccountSwitcher::switchBack

File

src/AccountSwitcherDecorator.php, line 17

Class

AccountSwitcherDecorator
Extend current account switcher service functionality.

Namespace

Drupal\acquia_contenthub

Code

public function switchBack() {

  // If there are no more accounts in the account stack,
  // current user will be the original user.
  if (count($this->accountStack) !== 0) {
    parent::switchBack();
  }
}