Skip to content

Commit

Permalink
fix(web): Restore Local Studio opening (#6081)
Browse files Browse the repository at this point in the history
  • Loading branch information
SokratisVidros authored Jul 16, 2024
1 parent a1ae2b3 commit c58f063
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/web/src/ApplicationReadyGuard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Navigate, useLocation } from 'react-router-dom';
import { type PropsWithChildren, useLayoutEffect } from 'react';
import { useAuth, useEnvironment } from './hooks';
import { isStudioRoute } from './studio/utils/routing';

export function ApplicationReadyGuard({ children }: PropsWithChildren<{}>) {
const location = useLocation();
const { isLoading: isLoadingAuth, inPublicRoute } = useAuth();
const { isLoading: isLoadingEnvironment } = useEnvironment();

const isLoading = isLoadingAuth || isLoadingEnvironment;
const isLoading = isLoadingAuth || (isStudioRoute(location.pathname) && isLoadingEnvironment);

// Clean up the skeleton loader when the app is ready
useLayoutEffect(() => {
Expand Down

0 comments on commit c58f063

Please sign in to comment.