Page MenuHomePhabricator

D14014.diff
No OneTemporary

D14014.diff

diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
--- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
+++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php
@@ -211,14 +211,14 @@
->addSigil('differential-inline-next')
->setMustCapture(true);
- $hide = id(new PHUIButtonView())
- ->setTag('a')
- ->setTooltip(pht('Hide Comment'))
- ->setIconFont('fa-times')
- ->addSigil('hide-inline')
- ->setMustCapture(true);
+ if ($this->canHide()) {
+ $hide = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setTooltip(pht('Hide Comment'))
+ ->setIconFont('fa-times')
+ ->addSigil('hide-inline')
+ ->setMustCapture(true);
- if ($viewer_phid && $inline->getID() && $inline->supportsHiding()) {
$nextprev->addButton($hide);
}
@@ -456,4 +456,27 @@
return $markup;
}
+ private function canHide() {
+ $inline = $this->inlineComment;
+
+ if ($inline->isDraft()) {
+ return false;
+ }
+
+ if (!$inline->getID()) {
+ return false;
+ }
+
+ $viewer = $this->getUser();
+ if (!$viewer->isLoggedIn()) {
+ return false;
+ }
+
+ if (!$inline->supportsHiding()) {
+ return false;
+ }
+
+ return true;
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Thu, May 9, 8:50 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6277252
Default Alt Text
D14014.diff (1 KB)

Event Timeline