Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ jobs:
- name: Tag Git Pre-Release
if: ${{ startsWith(env.RELEASE_TYPE, 'pre') }}
run: |
git tag -a "prelease-$(jq -r '.version' ./sdk/package.json)" -m "$(jq -r '.version' ./sdk/package.json)"
git push origin "prelease-$(jq -r '.version' ./sdk/package.json)"
git tag -a "prerelease-$(jq -r '.version' ./sdk/package.json)" -m "$(jq -r '.version' ./sdk/package.json)"
git push origin "prerelease-$(jq -r '.version' ./sdk/package.json)"

- name: Release to NPM
id: npm_release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
} from 'react';
import { motion } from 'framer-motion';
import { useTranslation } from 'react-i18next';
import { isError } from 'ethers';
import { UnableToConnectDrawer } from '../../../components/UnableToConnectDrawer/UnableToConnectDrawer';
import { ChangedYourMindDrawer } from '../../../components/ChangedYourMindDrawer/ChangedYourMindDrawer';
import { ConnectWidgetViews } from '../../../context/view-context/ConnectViewContextTypes';
Expand Down Expand Up @@ -204,6 +205,18 @@ export function WalletList(props: WalletListProps) {
}
}
} catch (err: any) {
if (
isError(err, 'INVALID_ARGUMENT')
&& err.message.includes('value={ "ethereumProvider": { "isPassport": true } }')) {
Copy link
Contributor

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?

Copy link
Contributor Author

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

// eslint-disable-next-line no-console
console.error(
'Invalid type',
'Unable to connect to the Passport provider.',
// eslint-disable-next-line max-len
'`await {passportInstance}.connectEvm()` must be called to initialize the provider before initalizing the Checkout SDK.',
);
}

// eslint-disable-next-line no-console
console.error('Connect unknown error', err);

Expand Down