diff --git a/apps/studio/components/interfaces/Auth/Users/UsersV2.tsx b/apps/studio/components/interfaces/Auth/Users/UsersV2.tsx index ae210967cf4..97d62ca60c9 100644 --- a/apps/studio/components/interfaces/Auth/Users/UsersV2.tsx +++ b/apps/studio/components/interfaces/Auth/Users/UsersV2.tsx @@ -75,6 +75,7 @@ import { import { formatUserColumns, formatUsersData } from './Users.utils' import { UsersFooter } from './UsersFooter' import { UsersSearch } from './UsersSearch' +import { PROJECT_STATUS } from '@/lib/constants/infrastructure' const SORT_BY_VALUE_COUNT_THRESHOLD = 10_000 const IMPROVED_SEARCH_COUNT_THRESHOLD = 10_000 @@ -90,7 +91,11 @@ limit 100` export const UsersV2 = () => { const queryClient = useQueryClient() const { ref: projectRef } = useParams() - const { data: project } = useSelectedProjectQuery() + const { + data: project, + isPending: isPendingProject, + isError: isProjectError, + } = useSelectedProjectQuery() const { data: selectedOrg } = useSelectedOrganizationQuery() const gridRef = useRef(null) const xScroll = useRef(0) @@ -283,6 +288,7 @@ export const UsersV2 = () => { data, error, isSuccess, + isPending, isLoading, isRefetching, isError, @@ -802,7 +808,21 @@ export const UsersV2 = () => { /> ) }, - noRowsFallback: isLoading ? ( + noRowsFallback: isPendingProject ? ( +
+ +
+ ) : project?.status !== PROJECT_STATUS.ACTIVE_HEALTHY || isProjectError ? ( +
+ +
+ ) : isPending ? (
@@ -810,7 +830,7 @@ export const UsersV2 = () => {
- ) : ( + ) : isSuccess ? (
@@ -826,7 +846,7 @@ export const UsersV2 = () => {

- ), + ) : null, }} />