From a8b62d3e81ffb17b117a5afe70f9f988e86896f1 Mon Sep 17 00:00:00 2001 From: alisalim17 Date: Wed, 27 Mar 2024 09:32:12 +0400 Subject: [PATCH] fix: profile is empty in billing modal --- libs/ui/app/container.tsx | 2 +- libs/ui/app/layout.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/ui/app/container.tsx b/libs/ui/app/container.tsx index e4c383cf4..f450a1502 100644 --- a/libs/ui/app/container.tsx +++ b/libs/ui/app/container.tsx @@ -10,7 +10,7 @@ interface RootLayoutProps { export default function RootLayout({ children, profile }: RootLayoutProps) { return (
- {process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY && ( + {profile && process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY && ( )} diff --git a/libs/ui/app/layout.tsx b/libs/ui/app/layout.tsx index 33be4d4d1..5c6ef92c6 100644 --- a/libs/ui/app/layout.tsx +++ b/libs/ui/app/layout.tsx @@ -2,7 +2,7 @@ import "@/styles/globals.css" import { Metadata } from "next" import { cookies } from "next/headers" -import { createRouteHandlerClient } from "@supabase/auth-helpers-nextjs" +import { createServerComponentClient } from "@supabase/auth-helpers-nextjs" import { siteConfig } from "@/config/site" import { fontSans } from "@/lib/fonts" @@ -37,7 +37,7 @@ interface RootLayoutProps { export const dynamic = "force-dynamic" export default async function RootLayout({ children }: RootLayoutProps) { - const supabase = createRouteHandlerClient({ cookies }) + const supabase = createServerComponentClient({ cookies }) if (process.env.NEXT_PUBLIC_POSTHOG_KEY) { PostHogClient()