atproto explorer

navigate to logged in repo when searching me

handle.invalid ddf7050c 2e07016d

verified
+12 -9
+12 -9
src/components/search.tsx
··· 47 47 input = input.trim().replace(/^@/, ""); 48 48 if (!input.length) return; 49 49 setShowSearch(false); 50 - if ( 50 + if (input === "me" && localStorage.getItem("lastSignedIn") !== null) { 51 + navigate(`/at://${localStorage.getItem("lastSignedIn")}`); 52 + } else if ( 51 53 !input.startsWith("https://bsky.app/") && 52 54 (input.startsWith("https://") || input.startsWith("http://")) 53 55 ) { 54 56 navigate(`/${input.replace("https://", "").replace("http://", "").replace("/", "")}`); 55 - return; 57 + } else { 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("/"); 63 + navigate( 64 + `/at://${uriParts[0]}${uriParts.length > 1 ? `/${uriParts.slice(1).join("/")}` : ""}`, 65 + ); 56 66 } 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("/"); 63 - navigate(`/at://${uriParts[0]}${uriParts.length > 1 ? `/${uriParts.slice(1).join("/")}` : ""}`); 64 67 }; 65 68 66 69 return (