Skip to content

Commit

Permalink
fix: network error when switching chains (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Addminus committed Nov 16, 2022
1 parent b6eab07 commit cb2b691
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/wallet-management/src/LiFiWalletManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export const useLiFiWalletManagement = () => {
const [signer, setSigner] = useState<Signer>();

const flushCurrentWalletData = () => {
console.log('flushing wallet data');

setCurrentConnector(() => undefined);
setCurrentProvider(() => undefined);
setSigner(() => undefined);
Expand All @@ -36,6 +34,7 @@ export const useLiFiWalletManagement = () => {
if (connector) {
const provider = new ethers.providers.Web3Provider(
connector.provider as ExternalProvider,
'any',
);
setCurrentProvider(() => provider);
setCurrentConnector(() => connector);
Expand Down Expand Up @@ -120,6 +119,6 @@ export const useLiFiWalletManagement = () => {
connect,
disconnect,
signer,
provider: currentProvider ?? priorityProvider,
provider: signer?.provider,
};
};

0 comments on commit cb2b691

Please sign in to comment.