From a1adee47b834679c19f6290861d618e43cd78fe0 Mon Sep 17 00:00:00 2001 From: Lakhan Baheti <94619783+1akhanBaheti@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:52:54 +0530 Subject: [PATCH] chore: redirection to profile after workpace delete/leave (#2937) --- web/components/page-views/signin.tsx | 3 +-- web/hooks/use-user-auth.tsx | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/web/components/page-views/signin.tsx b/web/components/page-views/signin.tsx index 891f19f76..d4cbfeaae 100644 --- a/web/components/page-views/signin.tsx +++ b/web/components/page-views/signin.tsx @@ -75,8 +75,7 @@ export const SignInView = observer(() => { const workspaceSlug = userSettings?.workspace?.last_workspace_slug || userSettings?.workspace?.fallback_workspace_slug; if (workspaceSlug) router.push(`/${workspaceSlug}`); - else if (userSettings.workspace.invites > 0) router.push("/invitations"); - else router.push("/create-workspace"); + else router.push("/profile"); }) .catch(() => { setLoading(false); diff --git a/web/hooks/use-user-auth.tsx b/web/hooks/use-user-auth.tsx index 7a86d5b80..882c0b713 100644 --- a/web/hooks/use-user-auth.tsx +++ b/web/hooks/use-user-auth.tsx @@ -40,14 +40,8 @@ const useUserAuth = (routeAuth: "sign-in" | "onboarding" | "admin" | null = "adm router.push(`/${userWorkspaces[0].slug}`); return; } else { - const invitations = await workspaceService.userWorkspaceInvitations(); - if (invitations.length > 0) { - router.push(`/invitations`); - return; - } else { - router.push(`/create-workspace`); - return; - } + router.push(`/profile`); + return; } }); };