Skip to content

Commit

Permalink
fix sdk playground disconnect (#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-jake authored Dec 19, 2024
1 parent e706f37 commit 15eda0e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ export function CBWSDKReactContextProvider({ children }: CBWSDKProviderProps) {
const handleDisconnect = () => {
// eslint-disable-next-line no-console
console.log('🔴 Disconnect detected');
window.ethereum.disconnect();
location.reload();
};

Expand All @@ -141,6 +140,7 @@ export function CBWSDKReactContextProvider({ children }: CBWSDKProviderProps) {
cbwprovider.on('accountsChanged', handleAccountsChanged);
cbwprovider.on('chainChanged', handleChainChanged);
cbwprovider.on('message', handleMessage);
cbwprovider.on('disconnect', handleDisconnect);

// Add request handler to check for 4100 errors
const originalRequest = cbwprovider.request.bind(cbwprovider);
Expand Down

0 comments on commit 15eda0e

Please sign in to comment.