diff --git a/.env.local b/.env.local index 2c19a94..296bf47 100644 --- a/.env.local +++ b/.env.local @@ -7,7 +7,3 @@ NEXT_PUBLIC_LAUNCH_ONLY_ROOT=false NEXT_PUBLIC_SHORTLINK_BASE_URL=http://localhost:8080 -# Brevo API key for beta sign up collection -BREVO_API_KEY=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 -BREVO_LIST_ID=9 - diff --git a/.env.production b/.env.production index 6d207b4..2053aee 100644 --- a/.env.production +++ b/.env.production @@ -2,10 +2,8 @@ NEXT_PUBLIC_API_BASE_URL=http://battlbuilder-api:8080 # Middleware to limited site to only root page -LAUNCH_ONLY_ROOT=true +LAUNCH_ONLY_ROOT=false NEXT_PUBLIC_SHORTLINK_BASE_URL=https://battl.build -# Brevo API key for beta sign up collection -BREVO_API_KEY=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 -BREVO_LIST_ID=9 + diff --git a/app/(app)/(builder)/builder/build/page.tsx b/app/(app)/(builder)/builder/build/page.tsx new file mode 100644 index 0000000..feaa532 --- /dev/null +++ b/app/(app)/(builder)/builder/build/page.tsx @@ -0,0 +1,43 @@ +"use client"; + +import { useEffect } from "react"; +import { useSearchParams, useRouter } from "next/navigation"; +import { Suspense } from "react"; + +const STORAGE_KEY = "gunbuilder-build-state"; + +function BuildLoader() { + const searchParams = useSearchParams(); + const router = useRouter(); + + useEffect(() => { + const encoded = searchParams.get("build"); + + if (encoded) { + try { + const decoded = JSON.parse(atob(encoded)); + if (decoded && typeof decoded === "object") { + localStorage.setItem(STORAGE_KEY, JSON.stringify(decoded)); + } + } catch { + // Bad payload — just go to builder anyway, it'll load fresh + } + } + + router.replace("/builder"); + }, [searchParams, router]); + + return ( +
+

Loading build…

+
+ ); +} + +export default function BuildPage() { + return ( + + + + ); +} diff --git a/app/page.tsx b/app/page.tsx index 4aca59a..ae89f50 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -172,12 +172,12 @@ export default function HomePage() {