diff --git a/packages/manager/.changeset/pr-10303-fixed-1710976860713.md b/packages/manager/.changeset/pr-10303-fixed-1710976860713.md new file mode 100644 index 00000000000..9a034ffd722 --- /dev/null +++ b/packages/manager/.changeset/pr-10303-fixed-1710976860713.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Fixed +--- + +Loading state missing from Users & Grants table ([#10303](https://github.com/linode/manager/pull/10303)) diff --git a/packages/manager/src/features/Users/UsersLanding.tsx b/packages/manager/src/features/Users/UsersLanding.tsx index a8e5744c58d..33bbb915719 100644 --- a/packages/manager/src/features/Users/UsersLanding.tsx +++ b/packages/manager/src/features/Users/UsersLanding.tsx @@ -49,7 +49,8 @@ export const UsersLanding = () => { ['user_type']: showProxyUserTable ? 'child' : undefined, }; - const { data: users, error, isLoading, refetch } = useAccountUsers({ + // Since this query is disabled for restricted users, use isInitialLoading. + const { data: users, error, isInitialLoading, refetch } = useAccountUsers({ filters: usersFilter, params: { page: pagination.page, @@ -59,10 +60,11 @@ export const UsersLanding = () => { const isRestrictedUser = profile?.restricted; + // Since this query is disabled for restricted users, use isInitialLoading. const { data: proxyUser, error: proxyUserError, - isLoading: isLoadingProxyUser, + isInitialLoading: isLoadingProxyUser, } = useAccountUsers({ enabled: flags.parentChildAccountAccess && showProxyUserTable && !isRestrictedUser, @@ -162,7 +164,7 @@ export const UsersLanding = () => { { const { error, isLoading, numCols, onDelete, users } = props; - if ((isLoading && !users) || (isLoading && users?.length === 0)) { - return ; - } - if (isLoading) { return ; } @@ -30,10 +26,13 @@ export const UsersLandingTableBody = (props: Props) => { return ; } + if (!users || users.length === 0) { + return ; + } + return ( - // eslint-disable-next-line react/jsx-no-useless-fragment <> - {users?.map((user) => ( + {users.map((user) => ( ))}