mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-07 08:26:15 +00:00
searchparams refactor
This commit is contained in:
parent
c1596f4ead
commit
6ea598d483
1 changed files with 3 additions and 9 deletions
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue