tangled
alpha
login
or
join now
retr0.id
/
pdsls
forked from
pds.ls/pdsls
1
fork
atom
atproto explorer
1
fork
atom
overview
issues
pulls
pipelines
add lex: for NSID search
handle.invalid
4 months ago
19822f39
b89c4a89
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+7
-1
1 changed file
expand all
collapse all
unified
split
src
components
search.tsx
+7
-1
src/components/search.tsx
···
1
1
import { Client, CredentialManager } from "@atcute/client";
2
2
+
import { Nsid } from "@atcute/lexicons";
2
3
import { A, useLocation, useNavigate } from "@solidjs/router";
3
4
import { createResource, createSignal, For, onCleanup, onMount, Show } from "solid-js";
4
5
import { isTouchDevice } from "../layout";
6
6
+
import { resolveLexiconAuthority } from "../utils/api";
5
7
import { appHandleLink, appList, appName, AppUrl } from "../utils/app-urls";
6
8
import { createDebouncedValue } from "../utils/hooks/debounced";
7
9
import { Modal } from "./modal";
···
64
66
const [input, setInput] = createSignal<string>();
65
67
const [search] = createResource(createDebouncedValue(input, 250), fetchTypeahead);
66
68
67
67
-
const processInput = (input: string) => {
69
69
+
const processInput = async (input: string) => {
68
70
input = input.trim().replace(/^@/, "");
69
71
if (!input.length) return;
70
72
setShowSearch(false);
···
83
85
const uri = appHandleLink[app](path);
84
86
navigate(`/${uri}`);
85
87
}
88
88
+
} else if (input.startsWith("lex:")) {
89
89
+
const nsid = input.replace("lex:", "") as Nsid;
90
90
+
const res = await resolveLexiconAuthority(nsid);
91
91
+
navigate(`/at://${res}/com.atproto.lexicon.schema/${nsid}`);
86
92
} else {
87
93
navigate(`/at://${input.replace("at://", "")}`);
88
94
}