From 6a0cabf2490db4ea9db77c968d87c4fd336fb1a5 Mon Sep 17 00:00:00 2001 From: Dhruwang Jariwala <67850763+Dhruwang@users.noreply.github.com> Date: Sat, 6 Jul 2024 14:38:12 +0530 Subject: [PATCH] fix: invite functionality for providers (#2852) --- apps/web/app/(auth)/invite/page.tsx | 2 ++ apps/web/app/page.tsx | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/web/app/(auth)/invite/page.tsx b/apps/web/app/(auth)/invite/page.tsx index 7c18854517..b67def8e32 100644 --- a/apps/web/app/(auth)/invite/page.tsx +++ b/apps/web/app/(auth)/invite/page.tsx @@ -88,6 +88,8 @@ const Page = async ({ searchParams }) => { await updateUser(session.user.id, { notificationSettings: { ...session.user.notificationSettings, + alert: session.user.notificationSettings.alert ?? {}, + weeklySummary: session.user.notificationSettings.weeklySummary ?? {}, unsubscribedOrganizationIds: Array.from( new Set([ ...(session.user.notificationSettings?.unsubscribedOrganizationIds || []), diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 21a799bf9f..787e4c3e4d 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -27,9 +27,6 @@ const Page = async () => { let environment: TEnvironment | null = null; try { environment = await getFirstEnvironmentByUserId(session?.user.id); - if (!environment) { - throw new Error("No environment found"); - } } catch (error) { console.error(`error getting environment: ${error}`); } @@ -41,7 +38,7 @@ const Page = async () => { } if (!environment) { - console.error("Failed to get first environment of user; signing out"); + console.error("Failed to get first environment of user"); return redirect(`/organizations/${userOrganizations[0].id}/products/new/channel`); }