diff --git a/components/hero-chat.tsx b/components/hero-chat.tsx index 7c2235e..a9d1a7c 100644 --- a/components/hero-chat.tsx +++ b/components/hero-chat.tsx @@ -41,6 +41,7 @@ export function HeroChat() { const [submitted, setSubmitted] = useState(false) const [error, setError] = useState(null) const [activeCategory, setActiveCategory] = useState(null) + const [isPublic, setIsPublic] = useState(true) async function handleSubmit() { const idea = message.trim() @@ -49,20 +50,21 @@ export function HeroChat() { setSubmitted(true) setError(null) - const returnTo = `/dashboard?idea=${ideaParam(idea)}` + const ideaQuery = `idea=${ideaParam(idea)}&public=${String(isPublic)}` + const returnTo = `/dashboard?${ideaQuery}` try { const response = await fetch('/api/auth/me', { cache: 'no-store' }) if (!response.ok) { - window.location.href = `/sign-in?returnTo=${encodeURIComponent(returnTo)}&idea=${ideaParam(idea)}` + window.location.href = `/sign-in?returnTo=${encodeURIComponent(returnTo)}&${ideaQuery}` return } const auth = (await response.json()) as AuthResponse if (!auth.authenticated) { - window.location.href = `/sign-in?returnTo=${encodeURIComponent(returnTo)}&idea=${ideaParam(idea)}` + window.location.href = `/sign-in?returnTo=${encodeURIComponent(returnTo)}&${ideaQuery}` return } @@ -71,7 +73,7 @@ export function HeroChat() { return } - window.location.href = `/pricing?idea=${ideaParam(idea)}` + window.location.href = `/pricing?${ideaQuery}` } catch { setSubmitted(false) setError('Could not check your session. Try again or sign in below.') @@ -138,10 +140,21 @@ export function HeroChat() { Claude 4.7 Opus -
- - Public -
+