+4
-4
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
+
const INVALID_HANDLE = 'handle.invalid'
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
-
.then((handle) =>
23
-
handle.startsWith('did:') ? 'invalid.handle' : handle,
24
-
)
25
-
.catch(() => 'invalid.handle'),
24
+
.then((handle) => (handle.startsWith('did:') ? INVALID_HANDLE : handle))
25
+
.catch(() => INVALID_HANDLE),
26
26
},
27
27
}
28
28
}