Fix broken MembersTable (#10300)

This commit is contained in:
Sergei Garin 2024-06-17 16:15:20 +03:00 committed by GitHub
parent 07955f870b
commit 0b4ea9a9fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,11 +46,14 @@ export default function MembersTable(props: MembersTableProps) {
() => (user == null ? null : { isPlaceholder: false, ...user }), () => (user == null ? null : { isPlaceholder: false, ...user }),
[user] [user]
) )
const backendListUsers = backendHooks.useBackendListUsers(backend)
const users = React.useMemo( const users = React.useMemo(
() => () =>
backendHooks.useBackendListUsers(backend) ?? backendListUsers ??
(populateWithSelf && userWithPlaceholder != null ? [userWithPlaceholder] : null), (populateWithSelf && userWithPlaceholder != null ? [userWithPlaceholder] : null),
[backend, populateWithSelf, userWithPlaceholder] [backendListUsers, populateWithSelf, userWithPlaceholder]
) )
const usersMap = React.useMemo( const usersMap = React.useMemo(
() => new Map((users ?? []).map(member => [member.userId, member])), () => new Map((users ?? []).map(member => [member.userId, member])),