···
import { A, useLocation, useNavigate } from "@solidjs/router";
import { createResource, createSignal, For, onCleanup, onMount, Show } from "solid-js";
import { isTouchDevice } from "../layout";
5
+
import { BskyClient, bskyClients } from "../utils/bsky-clients";
import { createDebouncedValue } from "../utils/hooks/debounced";
export const [showSearch, setShowSearch] = createSignal(false);
···
if (input === "me" && localStorage.getItem("lastSignedIn") !== null) {
navigate(`/at://${localStorage.getItem("lastSignedIn")}`);
72
-
!input.startsWith("https://bsky.app/") &&
73
-
(input.startsWith("https://") || input.startsWith("http://"))
75
-
navigate(`/${input.replace("https://", "").replace("http://", "").replace("/", "")}`);
} else if (search()?.length) {
navigate(`/at://${search()![0].did}`);
74
+
} else if (input.startsWith("https://") || input.startsWith("http://")) {
75
+
const host = input.slice(0, input.indexOf("/profile/", 8)) as BskyClient;
76
+
if (!bskyClients.has(host)) {
77
+
navigate(`/${input.replace("https://", "").replace("http://", "").replace("/", "")}`);
80
+
.replace("at://", "")
81
+
.replace(`${host}/profile/`, "")
82
+
.replace("/post/", "/app.bsky.feed.post/");
83
+
const uriParts = uri.split("/");
85
+
`/at://${uriParts[0]}${uriParts.length > 1 ? `/${uriParts.slice(1).join("/")}` : ""}`,
80
-
.replace("at://", "")
81
-
.replace("https://bsky.app/profile/", "")
82
-
.replace("/post/", "/app.bsky.feed.post/");
83
-
const uriParts = uri.split("/");
85
-
`/at://${uriParts[0]}${uriParts.length > 1 ? `/${uriParts.slice(1).join("/")}` : ""}`,
89
+
navigate(`/${input}`);