tangled
alpha
login
or
join now
graham.systems
/
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
extract invalid handle string
samuel.fm
9 months ago
446685bd
d016e910
+4
-4
1 changed file
expand all
collapse all
unified
split
packages
appview
src
lib
hydrate.ts
+4
-4
packages/appview/src/lib/hydrate.ts
···
7
7
import { AppContext } from '#/context'
8
8
import { Status } from '#/db'
9
9
10
10
+
const INVALID_HANDLE = 'handle.invalid'
11
11
+
10
12
export async function statusToStatusView(
11
13
status: Status,
12
14
ctx: AppContext,
···
19
21
did: status.authorDid,
20
22
handle: await ctx.resolver
21
23
.resolveDidToHandle(status.authorDid)
22
22
-
.then((handle) =>
23
23
-
handle.startsWith('did:') ? 'invalid.handle' : handle,
24
24
-
)
25
25
-
.catch(() => 'invalid.handle'),
24
24
+
.then((handle) => (handle.startsWith('did:') ? INVALID_HANDLE : handle))
25
25
+
.catch(() => INVALID_HANDLE),
26
26
},
27
27
}
28
28
}