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
import { AppContext } from '#/context'
8
import { Status } from '#/db'
9
0
0
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),
0
0
26
},
27
}
28
}