Skip to content

Commit

Permalink
Fix per-playmode open issues counter
Browse files Browse the repository at this point in the history
  • Loading branch information
nanaya committed Mar 12, 2018
1 parent 1b380fe commit 845cef3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions resources/assets/coffee/react/beatmap-discussions/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,19 @@ class BeatmapDiscussions.Main extends React.PureComponent
continue if _.isEmpty(d)

if !d.deleted_at? && d.can_be_resolved && !d.resolved
if !d.beatmap_id? || !@beatmaps()[d.beatmap_id]?.deleted_at?
beatmap = @beatmaps()[d.beatmap_id]

if !d.beatmap_id? || (beatmap? && !beatmap.deleted_at?)
unresolvedIssues++

if d.beatmap_id?
countsByBeatmap[d.beatmap_id] ?= 0
countsByBeatmap[d.beatmap_id]++
if beatmap?
countsByBeatmap[beatmap.id] ?= 0
countsByBeatmap[beatmap.id]++

if !beatmap.deleted_at?
countsByPlaymode[beatmap.mode] ?= 0
countsByPlaymode[beatmap.mode]++

mode = @beatmaps()[d.beatmap_id]?.mode
countsByPlaymode[mode] ?= 0
countsByPlaymode[mode]++

mode =
if d.beatmap_id?
Expand Down

0 comments on commit 845cef3

Please sign in to comment.