Skip to content

Commit

Permalink
fix: WalletList to select correct providerName (#1528)
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamoftrees authored Feb 26, 2024
1 parent 3c58e0e commit 5cfd597
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function WalletList(props: WalletListProps) {
const [wallets, setWallets] = useState<WalletInfo[]>([]);
const { track } = useAnalytics();

const selectWeb3Provider = useCallback((web3Provider: any) => {
const selectWeb3Provider = useCallback((web3Provider: any, providerName: string) => {
connectDispatch({
payload: {
type: ConnectActions.SET_PROVIDER,
Expand All @@ -52,7 +52,7 @@ export function WalletList(props: WalletListProps) {
connectDispatch({
payload: {
type: ConnectActions.SET_WALLET_PROVIDER_NAME,
walletProviderName: WalletProviderName.METAMASK,
walletProviderName: providerName as WalletProviderName,
},
});
}, []);
Expand All @@ -62,7 +62,7 @@ export function WalletList(props: WalletListProps) {
const connectCallback = async (ethereumProvider) => {
if (ethereumProvider.connected && ethereumProvider.session) {
const web3Provider = new Web3Provider(ethereumProvider as any);
selectWeb3Provider(web3Provider);
selectWeb3Provider(web3Provider, 'walletconnect');

const chainId = await web3Provider.getSigner().getChainId();
if (chainId !== targetChainId) {
Expand Down Expand Up @@ -130,7 +130,7 @@ export function WalletList(props: WalletListProps) {
walletProviderName,
});
const web3Provider = providerResult.provider;
selectWeb3Provider(web3Provider);
selectWeb3Provider(web3Provider, walletProviderName);

viewDispatch({
payload: {
Expand Down

0 comments on commit 5cfd597

Please sign in to comment.