Skip to content

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/twenty-front/src/modules/users/components/UserProvider.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@ import React from 'react';
22
import { useRecoilValue } from 'recoil';
33

44
import { isCurrentUserLoadedState } from '@/auth/states/isCurrentUserLoadingState';
5+
import { AppPath } from '@/types/AppPath';
6+
import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation';
57
import { UserOrMetadataLoader } from '~/loading/components/UserOrMetadataLoader';
68

79
export const UserProvider = ({ children }: React.PropsWithChildren) => {
810
const isCurrentUserLoaded = useRecoilValue(isCurrentUserLoadedState);
11+
const isMatchingLocation = useIsMatchingLocation();
912

10-
return !isCurrentUserLoaded ? <UserOrMetadataLoader /> : <>{children}</>;
13+
return !isCurrentUserLoaded &&
14+
!isMatchingLocation(AppPath.CreateWorkspace) ? (
15+
<UserOrMetadataLoader />
16+
) : (
17+
<>{children}</>
18+
);
1119
};

0 commit comments

Comments
 (0)