diff --git a/dapps/react-dapp-v2-with-ethers/src/contexts/ClientContext.tsx b/dapps/react-dapp-v2-with-ethers/src/contexts/ClientContext.tsx index fd94840..20ec0eb 100644 --- a/dapps/react-dapp-v2-with-ethers/src/contexts/ClientContext.tsx +++ b/dapps/react-dapp-v2-with-ethers/src/contexts/ClientContext.tsx @@ -82,12 +82,6 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac throw new Error("WalletConnect is not initialized"); } - let _session = {} as SessionTypes.Settled; - - if (_client.session.topics.length) { - _session = await _client.session.get(_client.session.topics[0]); - } - _client.on(CLIENT_EVENTS.pairing.proposal, async (proposal: PairingTypes.Proposal) => { const { uri } = proposal.signal.params; console.log("EVENT", "QR Code Modal open"); @@ -100,8 +94,7 @@ export function ClientContextProvider({ children }: { children: ReactNode | Reac setPairings(_client.pairing.topics); }); - _client.on(CLIENT_EVENTS.session.deleted, (deletedSession: SessionTypes.Settled) => { - if (deletedSession.topic !== _session?.topic) return; + _client.on(CLIENT_EVENTS.session.deleted, () => { console.log("EVENT", "session_deleted"); resetApp(); });