Skip to content

Commit

Permalink
Hide snoozed reports in the queue as well
Browse files Browse the repository at this point in the history
  • Loading branch information
kraktus committed Mar 25, 2021
1 parent 84dabd4 commit 46bc4ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/Report.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class Report(
api.maxScores zip env.streamer.api.approval.countRequests zip env.appeal.api.countUnread

private def renderList(me: Holder, room: String)(implicit ctx: Context) =
api.openAndRecentWithFilter(12, Room(room)) zip
api.openAndRecentWithFilter(asMod(me), 12, Room(room)) zip
getScores flatMap { case (reports, scores ~ streamers ~ appeals) =>
(env.user.lightUserApi preloadMany reports.flatMap(_.report.userIds)) inject
Ok(
Expand Down
4 changes: 2 additions & 2 deletions modules/report/src/main/ReportApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ final class ReportApi(
ReadPreference.secondaryPreferred
) dmap (_ filterNot ReporterId.lichess.==)

def openAndRecentWithFilter(nb: Int, room: Option[Room]): Fu[List[Report.WithSuspect]] =
def openAndRecentWithFilter(mod: Mod, nb: Int, room: Option[Room]): Fu[List[Report.WithSuspect]] =
for {
opens <- findBest(nb, selectOpenInRoom(room))
opens <- findBest(nb, selectOpenAvailableInRoom(room, snoozer snoozedIdsOf mod))
nbClosed = nb - opens.size
closed <-
if (room.has(Room.Xfiles) || nbClosed < 1) fuccess(Nil)
Expand Down

0 comments on commit 46bc4ab

Please sign in to comment.