Skip to content

Commit 5faf645

Browse files
committed
Fix how userId fallback is used on username
1 parent 7ba2b5f commit 5faf645

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

community-dashboard/app/components/ItemSelectInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function ItemSelectInput<Name extends string>(props: ItemSelectInputProps<Name>)
192192
() => ([
193193
...(usersData?.map((user) => ({
194194
id: user.userId,
195-
name: (isFalsyString(user.username) ? user.userId : user.username) ?? 'Unknown',
195+
name: (isFalsyString(user.username) ? user.userId : user.username),
196196
type: 'user' as const,
197197
})) ?? []),
198198
...(userGroupsData?.map((userGroup) => ({

community-dashboard/app/views/UserDashboard/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useMemo } from 'react';
22
import { gql, useQuery } from '@apollo/client';
3-
import { encodeDate, isDefined, isNotDefined } from '@togglecorp/fujs';
3+
import { encodeDate, isDefined, isFalsyString } from '@togglecorp/fujs';
44
import { useParams, generatePath, Link } from 'react-router-dom';
55

66
import useUrlState from '#hooks/useUrlState';
@@ -184,7 +184,7 @@ function UserDashboard(props: Props) {
184184
// NOTE: OSM user does not have username stored
185185
const userName = useMemo(() => {
186186
if (isDefined(userStats) && isDefined(userStats.user)) {
187-
return isNotDefined(userStats.user.username)
187+
return isFalsyString(userStats.user.username)
188188
? userStats.user.userId
189189
: userStats.user.username;
190190
}

0 commit comments

Comments
 (0)