New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only show discussion starters in user filter #3152

Merged
merged 6 commits into from May 9, 2018

Conversation

4 participants
@notbakaneko
Contributor

notbakaneko commented May 9, 2018

fixes #3148

@@ -121,6 +121,11 @@ class BeatmapDiscussions.Header extends React.PureComponent
beatmap: @props.currentBeatmap
discussionUsers: =>

This comment has been minimized.

@nekodex

nekodex May 9, 2018

Collaborator

How about discussionStarters or something to be more descriptive?

Also not sure if it's better to do this once-off when discussions are loaded as opposed to each render?

@peppy peppy added the resolves issue label May 9, 2018

@@ -121,6 +121,11 @@ class BeatmapDiscussions.Header extends React.PureComponent
beatmap: @props.currentBeatmap
discussionUsers: =>
userIds = _.uniq(_.map(_.values(@props.discussions), 'user_id'))
_.pickBy(@props.users, (value) -> _.includes(userIds, value.id))

This comment has been minimized.

@nanaya

nanaya May 9, 2018

Collaborator

Here have a magic thingy chained written in javascript.

_($r.props.discussions).map('user_id').uniq().map(function(k){return $r.props.users[k]}).sortBy('username').value()

notbakaneko and others added some commits May 9, 2018

have some lodash chain
for less backwards reading
@nanaya

nanaya approved these changes May 9, 2018

@nanaya nanaya merged commit 6c86cbc into ppy:master May 9, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@notbakaneko notbakaneko deleted the notbakaneko:feature/beatmap-discussions-user-filter-only-starter branch May 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment