Hide snoozed reports in the queue as well

pull/8473/head
kraktus 2021-03-25 15:47:47 +00:00
parent 84dabd437b
commit 46bc4ab365
2 changed files with 3 additions and 3 deletions

View File

@ -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(

View File

@ -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)