1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Don't consider empty inlines when considering whether a revision has draft comments or not

Summary: Ref T13513. When computing whether a revision has draft comments or not, ignore empty inlines.

Test Plan: Added empty inlines to a revision, no longer saw a yellow "draft" bubble in the list UI.

Maniphest Tasks: T13513

Differential Revision: https://secure.phabricator.com/D21215
This commit is contained in:
epriestley 2020-05-04 10:21:25 -07:00
parent 9307f57747
commit 27b7ba814a

View file

@ -11,7 +11,7 @@ final class DifferentialTransactionQuery
PhabricatorUser $viewer,
DifferentialRevision $revision) {
return id(new DifferentialDiffInlineCommentQuery())
$inlines = id(new DifferentialDiffInlineCommentQuery())
->setViewer($viewer)
->withRevisionPHIDs(array($revision->getPHID()))
->withAuthorPHIDs(array($viewer->getPHID()))
@ -19,6 +19,15 @@ final class DifferentialTransactionQuery
->withIsDeleted(false)
->needReplyToComments(true)
->execute();
// Don't count empty inlines when considering draft state.
foreach ($inlines as $key => $inline) {
if ($inline->isEmptyInlineComment()) {
unset($inlines[$key]);
}
}
return $inlines;
}
}