Skip to content

Commit

Permalink
fix(connect-kit): WalletConnect lost connection after refreshing the …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
runjuu committed Jun 26, 2023
1 parent 72384ca commit e26b8f8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useConnect } from "wagmi";
import { showNotification } from "@mantine/notifications";

import { checkIsWalletConnectConnector } from "../utils";
import { connectorStore } from "./connectors/store";

export function useDefaultWalletConnect() {
const { connectAsync, connectors } = useConnect();
Expand All @@ -18,6 +19,8 @@ export function useDefaultWalletConnect() {
connector: connector,
});

connectorStore.getState().setConnectedConnectorId(connector.id);

if (result.chain.id !== connector.chains[0]?.id) {
connector.switchChain?.(preferredChainId);
}
Expand Down

1 comment on commit e26b8f8

@vercel
Copy link

@vercel vercel bot commented on e26b8f8 Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

crossbell-universe – ./

crossbell-universe-crossbell.vercel.app
crossbell-dev.vercel.app
crossbell-universe-git-main-crossbell.vercel.app

Please sign in to comment.