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 (