Skip to content

Commit

Permalink
Merge pull request #10969 from cl8n/fix-recent-votes
Browse files Browse the repository at this point in the history
Fix recent votes section of modding profile
  • Loading branch information
notbakaneko authored Feb 5, 2024
2 parents 9f8c854 + 0d62e44 commit 0a92872
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resources/js/modding-profile/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default class Main extends React.Component<BeatmapsetDiscussionsBundleJso
case 'posts':
return <Posts posts={this.props.posts} store={this.store} user={this.user} />;
case 'votes':
return <Votes users={this.props.users} votes={this.props.votes} />;
return <Votes users={this.store.users} votes={this.props.votes} />;
default:
switchNever(name);
throw new Error('unsupported extra page');
Expand Down
4 changes: 2 additions & 2 deletions resources/js/modding-profile/votes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const directions = ['received', 'given'] as const;
export type Direction = (typeof directions)[number];

interface Props {
users: Partial<Record<number, UserJson>>;
users: Map<number | null | undefined, UserJson>;
votes: Record<Direction, VoteSummary[]>;
}

Expand All @@ -38,7 +38,7 @@ export default class Votes extends React.Component<Props> {
/>
{this.props.votes[direction].length > 0 && (
<div className='modding-profile-list modding-profile-list--votes'>
{this.props.votes[direction].map((vote) => this.renderUser(vote.score, vote.count, this.props.users[vote.user_id]))}
{this.props.votes[direction].map((vote) => this.renderUser(vote.score, vote.count, this.props.users.get(vote.user_id)))}
</div>
)}
</React.Fragment>
Expand Down

0 comments on commit 0a92872

Please sign in to comment.