atproto explorer pdsls.dev
atproto tool

navigate to logged in repo when searching me

juli.ee ddf7050c 2e07016d

verified
Changed files
+12 -9
src
components
+12 -9
src/components/search.tsx
···
input = input.trim().replace(/^@/, "");
if (!input.length) return;
setShowSearch(false);
-
if (
+
if (input === "me" && localStorage.getItem("lastSignedIn") !== null) {
+
navigate(`/at://${localStorage.getItem("lastSignedIn")}`);
+
} else if (
!input.startsWith("https://bsky.app/") &&
(input.startsWith("https://") || input.startsWith("http://"))
) {
navigate(`/${input.replace("https://", "").replace("http://", "").replace("/", "")}`);
-
return;
+
} else {
+
const uri = input
+
.replace("at://", "")
+
.replace("https://bsky.app/profile/", "")
+
.replace("/post/", "/app.bsky.feed.post/");
+
const uriParts = uri.split("/");
+
navigate(
+
`/at://${uriParts[0]}${uriParts.length > 1 ? `/${uriParts.slice(1).join("/")}` : ""}`,
+
);
}
-
-
const uri = input
-
.replace("at://", "")
-
.replace("https://bsky.app/profile/", "")
-
.replace("/post/", "/app.bsky.feed.post/");
-
const uriParts = uri.split("/");
-
navigate(`/at://${uriParts[0]}${uriParts.length > 1 ? `/${uriParts.slice(1).join("/")}` : ""}`);
};
return (