This reverts commit 4ce7fc6987, to take
more time to address PR comments
This commit is contained in:
@ -2,11 +2,26 @@ import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { clientConfigApiStatusState } from '@/client-config/states/clientConfigApiStatusState';
|
||||
import { AppFullScreenErrorFallback } from '@/error-handler/components/AppFullScreenErrorFallback';
|
||||
import { AppPath } from '@/types/AppPath';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { isMatchingLocation } from '~/utils/isMatchingLocation';
|
||||
|
||||
export const ClientConfigProvider: React.FC<React.PropsWithChildren> = ({
|
||||
children,
|
||||
}) => {
|
||||
const { isErrored, error } = useRecoilValue(clientConfigApiStatusState);
|
||||
const { isLoaded, isErrored, error } = useRecoilValue(
|
||||
clientConfigApiStatusState,
|
||||
);
|
||||
|
||||
const location = useLocation();
|
||||
|
||||
// TODO: Implement a better loading strategy
|
||||
if (
|
||||
!isLoaded &&
|
||||
!isMatchingLocation(location, AppPath.Verify) &&
|
||||
!isMatchingLocation(location, AppPath.VerifyEmail)
|
||||
)
|
||||
return null;
|
||||
|
||||
return isErrored && error instanceof Error ? (
|
||||
<AppFullScreenErrorFallback
|
||||
|
||||
Reference in New Issue
Block a user