A decentralized music tracking and discovery platform built on AT Protocol 🎵
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use prompt param for loading redirect

Read prompt from the query and prefer it when redirecting from /loading,
redirecting to the API login with the prompt. Make handle and prompt
optional in route validation. Send only prompt in Main's loading URL
when present and rename onCreateAccount login action from
"create_account"
to "create"

+9 -5
+2 -2
apps/web/src/layouts/Main.tsx
··· 162 162 } 163 163 164 164 window.location.href = prompt 165 - ? `https://rocksky.pages.dev/loading?handle=${handle}&prompt=${prompt}` 165 + ? `https://rocksky.pages.dev/loading?prompt=${prompt}` 166 166 : `https://rocksky.pages.dev/loading?handle=${handle}`; 167 167 }; 168 168 169 169 const onCreateAccount = async () => { 170 - await onLogin("create_account"); 170 + await onLogin("create"); 171 171 }; 172 172 173 173 return (
+5 -2
apps/web/src/pages/loading/Loading.tsx
··· 4 4 import { API_URL } from "../../consts"; 5 5 6 6 function Loading() { 7 - const { handle } = useSearch({ strict: false }); 7 + const { handle, prompt } = useSearch({ strict: false }); 8 8 9 9 useEffect(() => { 10 + if (prompt) { 11 + window.location.href = `${API_URL}/login?prompt=${prompt}`; 12 + } 10 13 if (handle) { 11 14 window.location.href = `${API_URL}/login?handle=${handle}`; 12 15 } 13 - }, [handle]); 16 + }, [handle, prompt]); 14 17 15 18 return ( 16 19 <div className="flex justify-center items-center h-screen bg-[#fff] fixed top-0 left-0 w-full">
+2 -1
apps/web/src/routes/loading.tsx
··· 4 4 import LoadingPage from "../pages/loading"; 5 5 6 6 const validateSearch = z.object({ 7 - handle: z.string(), 7 + handle: z.string().optional(), 8 + prompt: z.string().optional(), 8 9 }); 9 10 10 11 export const Route = createFileRoute("/loading")({