-
Notifications
You must be signed in to change notification settings - Fork 34
feat(checkout): Surface instructions to fix an invalid passport provider parameter #2569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
View your CI Pipeline Execution ↗ for commit 4c578c8.
☁️ Nx Cloud last updated this comment at |
@@ -1218,6 +1218,11 @@ | |||
"body": "Check your wallet and try again, or close and try a different option", | |||
"actionButtonText": "Try again" | |||
}, | |||
"passportProviderError": { | |||
"heading": "Unable to connect", | |||
"body": "Have you called `await passport.connectEvm()` to initialize the passport provider?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think this should ever be exposed to the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this
} | ||
} | ||
} catch (err: any) { | ||
if ( | ||
isError(err, 'INVALID_ARGUMENT') | ||
&& err.message.includes('value={ "ethereumProvider": { "isPassport": true } }')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right place to handle this. We should be a level deeper, perhaps in the checkout.connect
call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can only call it here. The checkout.connect call won't pick up on this error. The only option we have for going deeper is in the WrappedBrowserProvider class constructor, however that will preemptively show the error, before a user clicks on passport.
I've also updated the implementation to just a console.error with instructions, similar to what we do for useProvidersContext in widgets-lib
c74fae0
to
540427c
Compare
f54c551
to
4c578c8
Compare
No description provided.