From 404a76496717ad7825eecf8c90ff877abe7ee809 Mon Sep 17 00:00:00 2001 From: rimar1337 <132627503+rimar1337@users.noreply.github.com> Date: Mon, 13 Oct 2025 20:28:05 +0700 Subject: [PATCH] constellation-based follow state --- src/components/Login.tsx | 20 ++++- src/routes/profile.$did/index.tsx | 51 ++++++++++-- src/utils/followState.ts | 129 ++++++++++++++++++++++++++++++ src/utils/useQuery.ts | 28 ++++--- 4 files changed, 210 insertions(+), 18 deletions(-) create mode 100644 src/utils/followState.ts diff --git a/src/components/Login.tsx b/src/components/Login.tsx index f388241..5c3a24b 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -154,7 +154,19 @@ const TabButton = ({ label, active, onClick }: { label: string; active: boolean; const OAuthForm = () => { const { loginWithOAuth } = useAuth(); const [handle, setHandle] = useState(""); - const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (handle.trim()) loginWithOAuth(handle); }; + + useEffect(() => { + const lastHandle = localStorage.getItem("lastHandle"); + if (lastHandle) setHandle(lastHandle); + }, []); + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + if (handle.trim()) { + localStorage.setItem("lastHandle", handle); + loginWithOAuth(handle); + } + }; return (