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
only serve valid statuses
samuel.fm
9 months ago
8728f2dc
202c167e
+11
-1
1 changed file
expand all
collapse all
unified
split
packages
appview
src
api
lexicons
getStatuses.ts
+11
-1
packages/appview/src/api/lexicons/getStatuses.ts
···
1
1
+
import { XyzStatusphereStatus } from '@statusphere/lexicon'
2
2
+
1
3
import { AppContext } from '#/context'
2
4
import { Server } from '#/lexicons'
3
5
import { statusToStatusView } from '#/lib/hydrate'
···
17
19
encoding: 'application/json',
18
20
body: {
19
21
statuses: await Promise.all(
20
20
-
statuses.map((status) => statusToStatusView(status, ctx)),
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)),
21
31
),
22
32
},
23
33
}