atproto explorer

cleanup search logic

+1 -8
+1 -8
src/components/search.tsx
··· 44 }); 45 46 const processInput = async (input: string) => { 47 - (document.getElementById("uriForm") as HTMLFormElement).reset(); 48 - input = input 49 - .trim() 50 - .replace(/\u202c$/, "") 51 - .replace(/^\u202a/, "") 52 - .replace(/^@/, ""); 53 if (!input.length) return; 54 setShowSearch(false); 55 if ( 56 !input.startsWith("https://bsky.app/") && 57 - !input.startsWith("https://deer.social/") && 58 (input.startsWith("https://") || input.startsWith("http://")) 59 ) { 60 navigate(`/${input.replace("https://", "").replace("http://", "").replace("/", "")}`); ··· 63 64 const uri = input 65 .replace("at://", "") 66 - .replace("https://deer.social/profile/", "") 67 .replace("https://bsky.app/profile/", "") 68 .replace("/post/", "/app.bsky.feed.post/"); 69 const uriParts = uri.split("/");
··· 44 }); 45 46 const processInput = async (input: string) => { 47 + input = input.trim().replace(/^@/, ""); 48 if (!input.length) return; 49 setShowSearch(false); 50 if ( 51 !input.startsWith("https://bsky.app/") && 52 (input.startsWith("https://") || input.startsWith("http://")) 53 ) { 54 navigate(`/${input.replace("https://", "").replace("http://", "").replace("/", "")}`); ··· 57 58 const uri = input 59 .replace("at://", "") 60 .replace("https://bsky.app/profile/", "") 61 .replace("/post/", "/app.bsky.feed.post/"); 62 const uriParts = uri.split("/");