chore: handled the auto reload issue in auth-wrapper and instance wrapper (#4520)

This commit is contained in:
guru_sainath 2024-05-20 12:10:54 +05:30 committed by GitHub
parent b4b111e297
commit 603ebeb123
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ export const AuthenticationWrapper: FC<TAuthenticationWrapper> = observer((props
return redirectionRoute;
};
if (isUserSWRLoading || isUserLoading)
if ((isUserSWRLoading || isUserLoading) && !currentUser?.id)
return (
<div className="relative flex h-screen w-full items-center justify-center">
<LogoSpinner />

View File

@ -16,12 +16,12 @@ export const InstanceWrapper: FC<TInstanceWrapper> = observer((props) => {
// store
const { isLoading, instance, error, fetchInstanceInfo } = useInstance();
useSWR("INSTANCE_INFORMATION", () => fetchInstanceInfo(), {
const { isLoading: isInstanceSWRLoading } = useSWR("INSTANCE_INFORMATION", () => fetchInstanceInfo(), {
revalidateOnFocus: false,
});
// loading state
if (isLoading)
if ((isLoading || isInstanceSWRLoading) && !instance)
return (
<div className="relative flex h-screen w-full items-center justify-center">
<LogoSpinner />