Skip to content

Commit 316a429

Browse files
committed
Fix type error
1 parent 0d7db12 commit 316a429

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/lib/use-seam-client.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export function useSeamClient(): {
3030
queryKeyPrefix,
3131
...context
3232
} = useSeamQueryContext()
33+
const seamClientOptions =
34+
clientOptions?.endpoint == null
35+
? undefined
36+
: { endpoint: clientOptions.endpoint }
3337
const userIdentifierKey = useUserIdentifierKeyOrFingerprint(
3438
clientSessionToken != null ? '' : context.userIdentifierKey,
3539
)
@@ -64,7 +68,7 @@ export function useSeamClient(): {
6468
if (clientSessionToken != null) {
6569
const seam = SeamHttp.fromClientSessionToken(
6670
clientSessionToken,
67-
clientOptions,
71+
seamClientOptions,
6872
)
6973

7074
return {
@@ -79,7 +83,7 @@ export function useSeamClient(): {
7983
const seam = await SeamHttp.fromPublishableKey(
8084
publishableKey,
8185
userIdentifierKey,
82-
clientOptions,
86+
seamClientOptions,
8387
)
8488

8589
return {
@@ -94,7 +98,7 @@ export function useSeamClient(): {
9498
const clientWithoutWorkspace =
9599
SeamHttpWithoutWorkspace.fromConsoleSessionToken(
96100
consoleSessionToken,
97-
clientOptions,
101+
seamClientOptions,
98102
)
99103

100104
const endpointClientWithoutWorkspace =
@@ -114,7 +118,7 @@ export function useSeamClient(): {
114118
const seam = SeamHttp.fromConsoleSessionToken(
115119
consoleSessionToken,
116120
workspaceId,
117-
clientOptions,
121+
seamClientOptions,
118122
)
119123

120124
return {

0 commit comments

Comments
 (0)