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

extract invalid handle string

Changed files
+4 -4
packages
appview
src
+4 -4
packages/appview/src/lib/hydrate.ts
··· 7 import { AppContext } from '#/context' 8 import { Status } from '#/db' 9 10 export async function statusToStatusView( 11 status: Status, 12 ctx: AppContext, ··· 19 did: status.authorDid, 20 handle: await ctx.resolver 21 .resolveDidToHandle(status.authorDid) 22 - .then((handle) => 23 - handle.startsWith('did:') ? 'invalid.handle' : handle, 24 - ) 25 - .catch(() => 'invalid.handle'), 26 }, 27 } 28 }
··· 7 import { AppContext } from '#/context' 8 import { Status } from '#/db' 9 10 + const INVALID_HANDLE = 'handle.invalid' 11 + 12 export async function statusToStatusView( 13 status: Status, 14 ctx: AppContext, ··· 21 did: status.authorDid, 22 handle: await ctx.resolver 23 .resolveDidToHandle(status.authorDid) 24 + .then((handle) => (handle.startsWith('did:') ? INVALID_HANDLE : handle)) 25 + .catch(() => INVALID_HANDLE), 26 }, 27 } 28 }