1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-26 03:00:45 +01:00

Don't prompt to mark notifications as read if we don't need to

Summary: Fixes whatever task is tracking this junk, if one exists. Don't prompt unless there's a security issue.

Test Plan:
  - Generated notifications from a test account.
  - Clicked "Mark All" from dropdown menu, no prompt.
  - Clicked "Mark All" from notifications screen, no prompt.
  - Command-Clicked "Mark All" from dropdown menu to open in new window, got normal prompt.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D18483
This commit is contained in:
epriestley 2017-08-28 12:12:13 -07:00
parent b8b701faf7
commit 643877b467

View file

@ -8,6 +8,17 @@ final class PhabricatorNotificationClearController
$chrono_key = $request->getStr('chronoKey');
if ($request->isDialogFormPost()) {
$should_clear = true;
} else {
try {
$request->validateCSRF();
$should_clear = true;
} catch (AphrontMalformedRequestException $ex) {
$should_clear = false;
}
}
if ($should_clear) {
$table = new PhabricatorFeedStoryNotification();
queryfx(