diff --git a/web/app/onboarding/page.tsx b/web/app/onboarding/page.tsx index 7f314a08d..b8cd881ad 100644 --- a/web/app/onboarding/page.tsx +++ b/web/app/onboarding/page.tsx @@ -43,25 +43,13 @@ const OnboardingPage = observer(() => { // computed values const workspacesList = Object.values(workspaces ?? {}); // fetching workspaces list - const { isLoading: workspaceListLoader } = useSWR( - USER_WORKSPACES_LIST, - () => { - user?.id && fetchWorkspaces(); - }, - { - shouldRetryOnError: false, - } - ); + const { isLoading: workspaceListLoader } = useSWR(USER_WORKSPACES_LIST, () => { + user?.id && fetchWorkspaces(); + }); // fetching user workspace invitations - const { data: invitations } = useSWR( - "USER_WORKSPACE_INVITATIONS_LIST", - () => { - user?.id && workspaceService.userWorkspaceInvitations(); - }, - { - shouldRetryOnError: false, - } - ); + const { isLoading: invitationsLoader, data: invitations } = useSWR("USER_WORKSPACE_INVITATIONS_LIST", () => { + if (user?.id) return workspaceService.userWorkspaceInvitations(); + }); // handle step change const stepChange = async (steps: Partial) => { if (!user) return; @@ -144,7 +132,7 @@ const OnboardingPage = observer(() => { return ( - {user && totalSteps && step !== null && invitations ? ( + {user && totalSteps && step !== null && !invitationsLoader ? (
{step === EOnboardingSteps.PROFILE_SETUP ? ( { /> ) : step === EOnboardingSteps.WORKSPACE_CREATE_OR_JOIN ? (