Skip to content

Commit

Permalink
Show full incident count to super users
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Sep 21, 2023
1 parent 5b0f46d commit 3fb4fbb
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ export function IncidentReportTracker(): JSX.Element {

function updateCt(count: number) {
const user = data.get("user");

if (user.is_superuser) {
setNormalCt(count);
return;
}

if (user.is_moderator || user.moderator_powers > 0) {
const handled_today = user.reports_handled_today || 0;
setNormalCt(Math.max(0, Math.min(count, DAILY_REPORT_GOAL - handled_today)));
Expand Down

0 comments on commit 3fb4fbb

Please sign in to comment.