fix: Set profile as active nav entry

Signed-off-by: Christopher Ng <chrng8@gmail.com>
pull/41122/head
Christopher Ng 3 years ago
parent 407b67989d
commit d899e676de
  1. 4
      core/Controller/ProfilePageController.php

@ -40,6 +40,7 @@ use OCP\IUserSession;
use OCP\Share\IManager as IShareManager;
use OCP\UserStatus\IManager as IUserStatusManager;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\INavigationManager;
#[IgnoreOpenAPI]
class ProfilePageController extends Controller {
@ -52,6 +53,7 @@ class ProfilePageController extends Controller {
private IUserManager $userManager,
private IUserSession $userSession,
private IUserStatusManager $userStatusManager,
private INavigationManager $navigationManager,
private IEventDispatcher $eventDispatcher,
) {
parent::__construct($appName, $request);
@ -104,6 +106,8 @@ class ProfilePageController extends Controller {
$this->profileManager->getProfileFields($targetUser, $visitingUser),
);
$this->navigationManager->setActiveEntry('profile');
$this->eventDispatcher->dispatchTyped(new BeforeTemplateRenderedEvent($targetUserId));
\OCP\Util::addScript('core', 'profile');

Loading…
Cancel
Save