diff --git a/package.json b/package.json index d75f8e1..7476681 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@neynar/create-farcaster-mini-app", - "version": "1.7.7", + "version": "1.7.8", "type": "module", "private": false, "access": "public", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f009466..6b3ad05 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,8 +1,8 @@ -import type { Metadata } from "next"; +import type { Metadata } from 'next'; -import "~/app/globals.css"; -import { Providers } from "~/app/providers"; -import { APP_NAME, APP_DESCRIPTION } from "~/lib/constants"; +import '~/app/globals.css'; +import { Providers } from '~/app/providers'; +import { APP_NAME, APP_DESCRIPTION } from '~/lib/constants'; export const metadata: Metadata = { title: APP_NAME, @@ -13,15 +13,16 @@ export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; -}>) { +}>) { // Only get session if sponsored signer is enabled or seed phrase is provided const sponsorSigner = process.env.SPONSOR_SIGNER === 'true'; const hasSeedPhrase = !!process.env.SEED_PHRASE; - + const shouldUseSession = sponsorSigner || hasSeedPhrase; + let session = null; - if (sponsorSigner || hasSeedPhrase) { + if (shouldUseSession) { try { - const { getSession } = await import("~/auth"); + const { getSession } = await import('~/auth'); session = await getSession(); } catch (error) { console.warn('Failed to get session:', error); @@ -31,7 +32,9 @@ export default async function RootLayout({ return (
-