diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index b9205928..4c20bf67 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -510,7 +510,7 @@ const MemoryGraphPage = () => { variant="consumer" >
- @@ -566,7 +566,7 @@ const MemoryGraphPage = () => { totalLoaded={totalLoaded} >
- @@ -714,23 +714,6 @@ export default function Page() { const router = useRouter(); const { user } = useAuth(); - const { data: waitlistStatus, isLoading: isCheckingWaitlist } = useQuery({ - queryKey: ["waitlist-status", user?.id], - queryFn: async () => { - try { - const response = await $fetch("@get/waitlist/status"); - return response.data; - } catch (error) { - console.error("Error checking waitlist status:", error); - // Return null to indicate error, will handle in useEffect - return null; - } - }, - enabled: !!user && !user.isAnonymous, - staleTime: 5 * 60 * 1000, // 5 minutes - retry: 1, // Only retry once on failure - }); - useEffect(() => { // save the token for chrome extension const url = new URL(window.location.href); @@ -744,14 +727,8 @@ export default function Page() { } }, []); - useEffect(() => { - if (waitlistStatus && !waitlistStatus.accessGranted) { - router.push("/waitlist"); - } - }, [waitlistStatus, router]); - // Show loading state while checking authentication and waitlist status - if (!user || isCheckingWaitlist) { + if (!user) { return (
diff --git a/apps/web/app/ref/[code]/page.tsx b/apps/web/app/ref/[code]/page.tsx index 3acbe657..98afcfe5 100644 --- a/apps/web/app/ref/[code]/page.tsx +++ b/apps/web/app/ref/[code]/page.tsx @@ -20,7 +20,6 @@ export default function ReferralPage() { const params = useParams(); const referralCode = params.code as string; - const [isJoiningWaitlist, setIsJoiningWaitlist] = useState(false); const [isLoading, setIsLoading] = useState(true); const [referralData, setReferralData] = useState<{ referrerName?: string; @@ -56,18 +55,7 @@ export default function ReferralPage() { checkReferral(); }, [referralCode]); - const handleJoinWaitlist = async () => { - setIsJoiningWaitlist(true); - try { - // Redirect to waitlist signup with referral code - router.push(`/waitlist?ref=${referralCode}`); - } catch (error) { - console.error("Error joining waitlist:", error); - toast.error("Failed to join waitlist. Please try again."); - } finally { - setIsJoiningWaitlist(false); - } - }; + const handleCopyLink = async () => { try { @@ -158,17 +146,6 @@ export default function ReferralPage() {

-
- -
Learn more about supermemory diff --git a/apps/web/app/waitlist/page.tsx b/apps/web/app/waitlist/page.tsx deleted file mode 100644 index c5c2dfd6..00000000 --- a/apps/web/app/waitlist/page.tsx +++ /dev/null @@ -1,216 +0,0 @@ -"use client"; - -import { $fetch } from "@lib/api"; -import { authClient } from "@lib/auth"; -import { useAuth } from "@lib/auth-context"; -import { fetchConsumerProProduct } from "@lib/queries"; -import { Button } from "@ui/components/button"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@ui/components/card"; -import { useCustomer } from "autumn-js/react"; -import { Clock, LoaderIcon, LogOut, SkipForwardIcon } from "lucide-react"; -import Link from "next/link"; -import { useRouter, useSearchParams } from "next/navigation"; -import { useEffect, useState } from "react"; -import { toast } from "sonner"; - -export default function WaitlistPage() { - const router = useRouter(); - const searchParams = useSearchParams(); - const referralCode = searchParams.get("ref"); - const { user } = useAuth(); - const [isChecking, setIsChecking] = useState(true); - const [isSkippingWaitlist, setIsSkippingWaitlist] = useState(false); - const [waitlistStatus, setWaitlistStatus] = useState<{ - inWaitlist: boolean; - accessGranted: boolean; - createdAt: string; - } | null>(null); - const autumn = useCustomer(); - - const { data: earlyAccess } = fetchConsumerProProduct(autumn); - - const handleSkipWaitlist = async () => { - setIsSkippingWaitlist(true); - try { - const res = await autumn.attach({ - productId: "consumer_pro", - forceCheckout: true, - successUrl: "https://app.supermemory.ai/", - }); - if (res.data && "checkout_url" in res.data && res.data.checkout_url) { - router.push(res.data.checkout_url); - } - } catch (error) { - console.error("Error skipping waitlist:", error); - } finally { - setIsSkippingWaitlist(false); - } - }; - - const handleLogout = async () => { - try { - await authClient.signOut(); - router.push("/"); - } catch (error) { - console.error("Error signing out:", error); - toast.error("Failed to sign out"); - } - }; - - useEffect(() => { - async function checkAccess() { - if (!user) { - router.push("/"); - return; - } - - // Anonymous users should sign in first - if (user.isAnonymous) { - authClient.signOut(); - router.push("/"); - return; - } - - try { - // Check waitlist status using the new endpoint - const response = await $fetch("@get/waitlist/status"); - - if (response.data) { - setWaitlistStatus(response.data); - - if (!response.data.inWaitlist) { - authClient.signOut(); - router.push("/login"); - } - - // If user has access, redirect to home - if (response.data.accessGranted) { - router.push("/"); - } - } - } catch (error) { - console.error("Error checking waitlist status:", error); - // If there's an error, assume user is on waitlist - setWaitlistStatus({ - inWaitlist: true, - accessGranted: false, - createdAt: new Date().toISOString(), - }); - } finally { - setIsChecking(false); - } - } - - checkAccess(); - }, [user, router]); - - if (isChecking) { - return ( -
-
- -

Checking access...

-
-
- ); - } - - return ( -
- - -
- -
- - You're on the waitlist! - - - {referralCode - ? "Thanks for joining through a friend's invitation! You've been added to the waitlist with priority access." - : "Thanks for your interest in supermemory. We'll notify you as soon as we're ready for you."} - - {referralCode && ( -
-

- 🎉 Referred by a friend! You'll get priority access. -

-
- )} -
- -
- {!earlyAccess?.allowed && ( - - )} -
-

- We're working hard to bring you the best experience. In the - meantime, you can: -

- -
- - {user && ( -
-

- Signed in as {user.email} -

- -
- )} -
-
-
-
- ); -} diff --git a/apps/web/components/views/chat/chat-messages.tsx b/apps/web/components/views/chat/chat-messages.tsx index 1b338b0f..85f91565 100644 --- a/apps/web/components/views/chat/chat-messages.tsx +++ b/apps/web/components/views/chat/chat-messages.tsx @@ -5,7 +5,15 @@ import { cn } from "@lib/utils"; import { Button } from "@ui/components/button"; import { Input } from "@ui/components/input"; import { DefaultChatTransport } from "ai"; -import { ArrowUp, Check, Copy, RotateCcw, X, ChevronDown, ChevronRight } from "lucide-react"; +import { + ArrowUp, + Check, + ChevronDown, + ChevronRight, + Copy, + RotateCcw, + X, +} from "lucide-react"; import { useEffect, useRef, useState } from "react"; import { toast } from "sonner"; import { Streamdown } from "streamdown"; @@ -41,8 +49,9 @@ function ExpandableMemories({ foundCount, results }: ExpandableMemoriesProps) { return (
- + {isExpanded && results.length > 0 && (
{results.map((result, index) => { - const isClickable = result.url && (result.url.startsWith('http://') || result.url.startsWith('https://')); - + const isClickable = + result.url && + (result.url.startsWith("http://") || + result.url.startsWith("https://")); + const content = ( <> {result.title && ( @@ -86,11 +98,11 @@ function ExpandableMemories({ foundCount, results }: ExpandableMemoriesProps) { if (isClickable) { return ( {content} @@ -99,8 +111,8 @@ function ExpandableMemories({ foundCount, results }: ExpandableMemoriesProps) { return (
{content}
@@ -376,12 +388,16 @@ export function ChatMessages() { "count" in output ? Number(output.count) || 0 : 0; - const results = Array.isArray(output?.results) ? output.results : []; - + // @ts-expect-error + const results = Array.isArray(output?.results) + ? // @ts-expect-error + output.results + : []; + return ( );