tangled
alpha
login
or
join now
danabra.mov
/
statusphere-react
forked from
samuel.fm/statusphere-react
0
fork
atom
the statusphere demo reworked into a vite/react app in a monorepo
0
fork
atom
overview
issues
pulls
pipelines
filter out handles that resolve as did
samuel.fm
9 months ago
dfe04754
8728f2dc
+5
-11
2 changed files
expand all
collapse all
unified
split
packages
appview
src
api
lexicons
getStatuses.ts
lib
hydrate.ts
+1
-11
packages/appview/src/api/lexicons/getStatuses.ts
···
1
1
-
import { XyzStatusphereStatus } from '@statusphere/lexicon'
2
2
-
3
1
import { AppContext } from '#/context'
4
2
import { Server } from '#/lexicons'
5
3
import { statusToStatusView } from '#/lib/hydrate'
···
19
17
encoding: 'application/json',
20
18
body: {
21
19
statuses: await Promise.all(
22
22
-
statuses
23
23
-
.filter(
24
24
-
(status) =>
25
25
-
XyzStatusphereStatus.validateRecord({
26
26
-
$type: 'xyz.statusphere.status',
27
27
-
...status,
28
28
-
}).success,
29
29
-
)
30
30
-
.map((status) => statusToStatusView(status, ctx)),
20
20
+
statuses.map((status) => statusToStatusView(status, ctx)),
31
21
),
32
22
},
33
23
}
+4
packages/appview/src/lib/hydrate.ts
···
1
1
+
import assert from 'node:assert'
1
2
import {
2
3
AppBskyActorDefs,
3
4
AppBskyActorProfile,
···
19
20
did: status.authorDid,
20
21
handle: await ctx.resolver
21
22
.resolveDidToHandle(status.authorDid)
23
23
+
.then((handle) =>
24
24
+
handle.startsWith('did:') ? 'invalid.handle' : handle,
25
25
+
)
22
26
.catch(() => 'invalid.handle'),
23
27
},
24
28
}