+2
-3
src/utils/api.ts
+2
-3
src/utils/api.ts
···
1
-
import { query } from "@solidjs/router";
2
1
import { createStore } from "solid-js/store";
3
2
4
3
import "@atcute/atproto";
···
38
37
const didPDSCache: Record<string, string> = {};
39
38
const [labelerCache, setLabelerCache] = createStore<Record<string, string>>({});
40
39
const didDocCache: Record<string, DidDocument> = {};
41
-
const getPDS = query(async (did: string) => {
40
+
const getPDS = async (did: string) => {
42
41
if (did in didPDSCache) return didPDSCache[did];
43
42
44
43
if (!isAtprotoDid(did)) {
···
60
59
}
61
60
62
61
return (didPDSCache[did] = pds);
63
-
}, "getPDS");
62
+
};
64
63
65
64
const resolveHandle = async (handle: Handle) => {
66
65
if (!isHandle(handle)) {
+9
-12
src/views/blob.tsx
+9
-12
src/views/blob.tsx
···
1
1
import { createResource, createSignal, For, Show } from "solid-js";
2
2
import { Client, CredentialManager } from "@atcute/client";
3
-
import { query, useParams } from "@solidjs/router";
3
+
import { useParams } from "@solidjs/router";
4
4
import { resolvePDS } from "../utils/api.js";
5
5
6
6
const LIMIT = 1000;
···
12
12
let pds: string;
13
13
let rpc: Client;
14
14
15
-
const listBlobs = query(
16
-
(did: string, cursor: string | undefined) =>
17
-
rpc.get("com.atproto.sync.listBlobs", {
18
-
params: {
19
-
did: did as `did:${string}:${string}`,
20
-
limit: LIMIT,
21
-
cursor: cursor,
22
-
},
23
-
}),
24
-
"listBlobs",
25
-
);
15
+
const listBlobs = (did: string, cursor: string | undefined) =>
16
+
rpc.get("com.atproto.sync.listBlobs", {
17
+
params: {
18
+
did: did as `did:${string}:${string}`,
19
+
limit: LIMIT,
20
+
cursor: cursor,
21
+
},
22
+
});
26
23
27
24
const fetchBlobs = async () => {
28
25
if (!pds) pds = await resolvePDS(did);
+9
-12
src/views/record.tsx
+9
-12
src/views/record.tsx
···
1
1
import { CredentialManager, Client } from "@atcute/client";
2
2
3
-
import { query, useParams } from "@solidjs/router";
3
+
import { useParams } from "@solidjs/router";
4
4
import { createSignal, onCleanup, onMount, Show } from "solid-js";
5
5
6
6
import { Backlinks } from "../components/backlinks.jsx";
···
109
109
window.removeEventListener("keydown", keyEvent);
110
110
});
111
111
112
-
const getRecord = query(
113
-
(repo: string, collection: string, rkey: string) =>
114
-
rpc.get("com.atproto.repo.getRecord", {
115
-
params: {
116
-
repo: repo as ActorIdentifier,
117
-
collection: collection as `${string}.${string}.${string}`,
118
-
rkey: rkey,
119
-
},
120
-
}),
121
-
"getRecord",
122
-
);
112
+
const getRecord = (repo: string, collection: string, rkey: string) =>
113
+
rpc.get("com.atproto.repo.getRecord", {
114
+
params: {
115
+
repo: repo as ActorIdentifier,
116
+
collection: collection as `${string}.${string}.${string}`,
117
+
rkey: rkey,
118
+
},
119
+
});
123
120
124
121
const deleteRecord = async () => {
125
122
rpc = new Client({ handler: agent });
+3
-6
src/views/repo.tsx
+3
-6
src/views/repo.tsx
···
1
1
import { createSignal, For, Show, createResource } from "solid-js";
2
2
import { Client, CredentialManager } from "@atcute/client";
3
-
import { A, query, useParams } from "@solidjs/router";
3
+
import { A, useParams } from "@solidjs/router";
4
4
import { didDocCache, getAllBacklinks, LinkData, resolvePDS } from "../utils/api.js";
5
5
import { Backlinks } from "../components/backlinks.jsx";
6
6
import { ActorIdentifier } from "@atcute/lexicons";
···
22
22
let pds: string;
23
23
const did = params.repo;
24
24
25
-
const describeRepo = query(
26
-
(repo: string) =>
27
-
rpc.get("com.atproto.repo.describeRepo", { params: { repo: repo as ActorIdentifier } }),
28
-
"describeRepo",
29
-
);
25
+
const describeRepo = (repo: string) =>
26
+
rpc.get("com.atproto.repo.describeRepo", { params: { repo: repo as ActorIdentifier } });
30
27
31
28
const fetchRepo = async () => {
32
29
pds = await resolvePDS(did);