Skip to content

Commit

Permalink
Mor logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Feb 15, 2023
1 parent ddab985 commit eb8e3db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/provider/use-metamask.ts
Expand Up @@ -8,7 +8,7 @@ export const useMetamask = ({
}: {
disable?: boolean;
}): { connect: () => void } => {
const { setProvider, setMissingProvider, handleLogout } = useMasa();
const { setProvider, setMissingProvider, handleLogout, walletAddress } = useMasa();

const provider = useMemo(() => {
if (typeof window !== 'undefined') {
Expand Down Expand Up @@ -77,7 +77,7 @@ export const useMetamask = ({
window?.ethereum?.on(
'accountsChanged',
async (accounts: unknown): Promise<void> => {
console.log('USE METAMASK', { accounts });
console.log('USE METAMASK', { accounts, walletAddress });
if (accounts instanceof Array && accounts.length === 0) {
setProvider?.(null);
await handleLogout?.();
Expand All @@ -104,7 +104,7 @@ export const useMetamask = ({
}
});
}
}, [handleLogout, disconnect, setProvider]);
}, [handleLogout, disconnect, setProvider, walletAddress]);

return { connect };
};

0 comments on commit eb8e3db

Please sign in to comment.