diff options
| author | codetorso <[email protected]> | 2024-07-18 19:22:29 +0530 |
|---|---|---|
| committer | codetorso <[email protected]> | 2024-07-18 19:22:29 +0530 |
| commit | 6ea598d483b1d397fa16c36f7764abfda6407e67 (patch) | |
| tree | d2b867f4a74eeeb15f25f1dfc0c9129d0b4fb5b7 /apps | |
| parent | bigger text, and fixing build errors (diff) | |
| download | supermemory-6ea598d483b1d397fa16c36f7764abfda6407e67.tar.xz supermemory-6ea598d483b1d397fa16c36f7764abfda6407e67.zip | |
searchparams refactor
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/web/app/(dash)/home/page.tsx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/apps/web/app/(dash)/home/page.tsx b/apps/web/app/(dash)/home/page.tsx index 43a4faa1..e388554b 100644 --- a/apps/web/app/(dash)/home/page.tsx +++ b/apps/web/app/(dash)/home/page.tsx @@ -23,25 +23,19 @@ function Page({ }: { searchParams: Record<string, string | string[] | undefined>; }) { - const [telegramUser, setTelegramUser] = useState<string | undefined>( - searchParams.telegramUser as string, - ); - const [extensionInstalled, setExtensionInstalled] = useState< - string | undefined - >(searchParams.extension as string); const { push } = useRouter(); const [spaces, setSpaces] = useState<{ id: number; name: string }[]>([]); - useEffect(() => { // telegram bot + const telegramUser = searchParams.extension as string if (telegramUser) { linkTelegram(telegramUser); } - if (extensionInstalled) { + if (searchParams.extension as string) { toast.success("Extension installed successfully"); } @@ -58,7 +52,7 @@ function Page({ if (typeof window === "undefined") return; window.postMessage({ token: token.data }, "*"); }); - }, [telegramUser]); + }, []); return ( <div className="max-w-3xl h-full justify-center flex mx-auto w-full flex-col px-2 md:px-0"> |