Skip to content

Commit 2a25a3c

Browse files
committed
fix: show xmtp sign in errors
1 parent c53330b commit 2a25a3c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

components/workflow-nodes/drawer/steps/credentials/SelectXmtpCredentials.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function SelectXmtpCredentials({ integrationAccount, reconnectAccount, on
2323

2424
const { data: signer } = useSigner()
2525

26-
const handleLensSignIn = useCallback(async () => {
26+
const handleXmtpSignIn = useCallback(async () => {
2727
if (!address || !signer) {
2828
return
2929
}
@@ -33,7 +33,15 @@ export function SelectXmtpCredentials({ integrationAccount, reconnectAccount, on
3333
}
3434
setLoading(true)
3535

36-
const keys = await Client.getKeys(signer, { env: 'production' })
36+
let keys: Uint8Array
37+
try {
38+
keys = await Client.getKeys(signer, { env: 'production' })
39+
} catch (err) {
40+
setLoading(false)
41+
setError(`Failed to sign message: ${(err as Error).message}`)
42+
return
43+
}
44+
3745
if (reconnectAccount) {
3846
const createCredentialRes = await updateCredential({
3947
variables: {
@@ -86,7 +94,7 @@ export function SelectXmtpCredentials({ integrationAccount, reconnectAccount, on
8694

8795
return (
8896
<div>
89-
<Button type="primary" onClick={() => handleLensSignIn()} loading={loading}>
97+
<Button type="primary" onClick={() => handleXmtpSignIn()} loading={loading}>
9098
Connect to XMTP
9199
</Button>
92100
<div className="mt-4">

0 commit comments

Comments
 (0)