Skip to content

Commit

Permalink
account for type of everyone option
Browse files Browse the repository at this point in the history
  • Loading branch information
notbakaneko committed Jul 31, 2023
1 parent d2e9113 commit 9e34a2e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions resources/js/beatmap-discussions/user-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const noSelection = Object.freeze({

interface Option {
groups: UserJson['groups'];
id: UserJson['id'];
id: UserJson['id'] | null;
text: UserJson['username'];
}

Expand Down Expand Up @@ -91,17 +91,14 @@ export class UserFilter extends React.Component<Props> {
}

private readonly renderOption = ({ cssClasses, children, onClick, option }: OptionRenderProps<Option>) => {
// TODO: exclude null/undefined user from discussionsState
if (option.id < 0) return;

const group = this.getGroup(option);
const style = groupColour(group);

const urlOptions = parseUrl();
// means it doesn't work on non-beatmapset discussion paths
if (urlOptions == null) return null;

urlOptions.user = option?.id;
urlOptions.user = option.id ?? undefined;

return (
<a
Expand Down

0 comments on commit 9e34a2e

Please sign in to comment.