the statusphere demo reworked into a vite/react app in a monorepo

filter out handles that resolve as did

Changed files
+5 -11
packages
appview
src
api
lexicons
lib
+1 -11
packages/appview/src/api/lexicons/getStatuses.ts
··· 1 - import { XyzStatusphereStatus } from '@statusphere/lexicon' 2 - 3 import { AppContext } from '#/context' 4 import { Server } from '#/lexicons' 5 import { statusToStatusView } from '#/lib/hydrate' ··· 19 encoding: 'application/json', 20 body: { 21 statuses: await Promise.all( 22 - statuses 23 - .filter( 24 - (status) => 25 - XyzStatusphereStatus.validateRecord({ 26 - $type: 'xyz.statusphere.status', 27 - ...status, 28 - }).success, 29 - ) 30 - .map((status) => statusToStatusView(status, ctx)), 31 ), 32 }, 33 }
··· 1 import { AppContext } from '#/context' 2 import { Server } from '#/lexicons' 3 import { statusToStatusView } from '#/lib/hydrate' ··· 17 encoding: 'application/json', 18 body: { 19 statuses: await Promise.all( 20 + statuses.map((status) => statusToStatusView(status, ctx)), 21 ), 22 }, 23 }
+4
packages/appview/src/lib/hydrate.ts
··· 1 import { 2 AppBskyActorDefs, 3 AppBskyActorProfile, ··· 19 did: status.authorDid, 20 handle: await ctx.resolver 21 .resolveDidToHandle(status.authorDid) 22 .catch(() => 'invalid.handle'), 23 }, 24 }
··· 1 + import assert from 'node:assert' 2 import { 3 AppBskyActorDefs, 4 AppBskyActorProfile, ··· 20 did: status.authorDid, 21 handle: await ctx.resolver 22 .resolveDidToHandle(status.authorDid) 23 + .then((handle) => 24 + handle.startsWith('did:') ? 'invalid.handle' : handle, 25 + ) 26 .catch(() => 'invalid.handle'), 27 }, 28 }