From bcb5cf7ad7b2a62fa25886a4df90e7d8171e1e17 Mon Sep 17 00:00:00 2001 From: martmull Date: Mon, 27 May 2024 12:14:50 +0200 Subject: [PATCH] Remove flash after create workspace (#5589) ## Before https://github.com/twentyhq/twenty/assets/29927851/a6b4f580-4f01-4f5b-a023-f9fa0d9f9c28 ## After https://github.com/twentyhq/twenty/assets/29927851/2a1feb44-27ce-457d-86a2-eea46a313f98 --- .../src/modules/users/components/UserProvider.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/users/components/UserProvider.tsx b/packages/twenty-front/src/modules/users/components/UserProvider.tsx index 806bcf35e..e35cbabfa 100644 --- a/packages/twenty-front/src/modules/users/components/UserProvider.tsx +++ b/packages/twenty-front/src/modules/users/components/UserProvider.tsx @@ -2,10 +2,18 @@ import React from 'react'; import { useRecoilValue } from 'recoil'; import { isCurrentUserLoadedState } from '@/auth/states/isCurrentUserLoadingState'; +import { AppPath } from '@/types/AppPath'; +import { useIsMatchingLocation } from '~/hooks/useIsMatchingLocation'; import { UserOrMetadataLoader } from '~/loading/components/UserOrMetadataLoader'; export const UserProvider = ({ children }: React.PropsWithChildren) => { const isCurrentUserLoaded = useRecoilValue(isCurrentUserLoadedState); + const isMatchingLocation = useIsMatchingLocation(); - return !isCurrentUserLoaded ? : <>{children}; + return !isCurrentUserLoaded && + !isMatchingLocation(AppPath.CreateWorkspace) ? ( + + ) : ( + <>{children} + ); };