Page MenuHomePhabricator

D17274.diff
No OneTemporary

D17274.diff

diff --git a/src/applications/home/controller/PhabricatorHomeMenuItemController.php b/src/applications/home/controller/PhabricatorHomeMenuItemController.php
--- a/src/applications/home/controller/PhabricatorHomeMenuItemController.php
+++ b/src/applications/home/controller/PhabricatorHomeMenuItemController.php
@@ -14,12 +14,6 @@
public function handleRequest(AphrontRequest $request) {
$viewer = $this->getViewer();
- if ($viewer->getPHID()) {
- $custom_phid = $viewer->getPHID();
- } else {
- $custom_phid = null;
- }
-
$application = 'PhabricatorHomeApplication';
$home_app = id(new PhabricatorApplicationQuery())
->setViewer($viewer)
@@ -29,7 +23,7 @@
$engine = id(new PhabricatorHomeProfileMenuEngine())
->setProfileObject($home_app)
- ->setCustomPHID($custom_phid)
+ ->setCustomPHID($viewer->getPHID())
->setController($this);
return $engine->buildResponse();
diff --git a/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php b/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php
--- a/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php
+++ b/src/applications/home/menuitem/PhabricatorHomeLauncherProfileMenuItem.php
@@ -49,16 +49,14 @@
PhabricatorProfileMenuItemConfiguration $config) {
$viewer = $this->getViewer();
- if ($viewer->isLoggedIn()) {
- $name = $this->getDisplayName($config);
- $icon = 'fa-globe';
- $href = '/applications/';
+ $name = $this->getDisplayName($config);
+ $icon = 'fa-globe';
+ $href = '/applications/';
- $item = $this->newItem()
- ->setHref($href)
- ->setName($name)
- ->setIcon($icon);
- }
+ $item = $this->newItem()
+ ->setHref($href)
+ ->setName($name)
+ ->setIcon($icon);
return array(
$item,
diff --git a/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php b/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php
--- a/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php
+++ b/src/applications/home/menuitem/PhabricatorHomeProfileMenuItem.php
@@ -56,17 +56,19 @@
PhabricatorProfileMenuItemConfiguration $config) {
$viewer = $this->getViewer();
- if ($viewer->isLoggedIn()) {
- $name = $this->getDisplayName($config);
- $icon = 'fa-home';
- $href = $this->getItemViewURI($config);
-
- $item = $this->newItem()
- ->setHref($href)
- ->setName($name)
- ->setIcon($icon);
+ if (!$viewer->isLoggedIn()) {
+ return array();
}
+ $name = $this->getDisplayName($config);
+ $icon = 'fa-home';
+ $href = $this->getItemViewURI($config);
+
+ $item = $this->newItem()
+ ->setHref($href)
+ ->setName($name)
+ ->setIcon($icon);
+
return array(
$item,
);

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 1:19 AM (13 h, 35 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6780509
Default Alt Text
D17274.diff (2 KB)

Event Timeline