Improve first loading performance

This commit is contained in:
Charles Bochet
2023-11-06 18:26:53 +01:00
parent 9bd6d26d53
commit 3d483b5640
2 changed files with 6 additions and 5 deletions

View File

@ -17,15 +17,12 @@ export const ClientConfigProvider: React.FC<React.PropsWithChildren> = ({
const [, setIsSignInPrefilled] = useRecoilState(isSignInPrefilledState);
const [, setTelemetry] = useRecoilState(telemetryState);
const [isLoading, setIsLoading] = useState(true);
const [setIsLoading] = useState(true);
const setSupportChat = useSetRecoilState(supportChatState);
const { data, loading } = useGetClientConfigQuery();
useEffect(() => {
if (!loading) {
setIsLoading(false);
}
if (data?.clientConfig) {
setAuthProviders({
google: data?.clientConfig.authProviders.google,
@ -49,5 +46,5 @@ export const ClientConfigProvider: React.FC<React.PropsWithChildren> = ({
setSupportChat,
]);
return isLoading ? <></> : <>{children}</>;
return <>{children}</>;
};