Skip to content

Commit db690e1

Browse files
committed
fix: identity
1 parent 9a4709e commit db690e1

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/components/WalletConnection/ConnectWalletButton.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,20 @@ export const ConnectWalletButton: React.FC<ConnectWalletProps> = ({ funnel, onCl
7575
}
7676

7777
previousConnectionState.current = isConnectingRef.current;
78-
}, [connectionStartTime, funnel, trackEvent, walletType]);
78+
}, [connectionStartTime, funnel, trackEvent, walletType, account]);
79+
80+
useEffect(() => {
81+
if (!account && walletType === undefined) {
82+
// Wallet disconnected - clear identity
83+
const identifyObj = new Identify().set('wallet_connected', false).unset('wallet_type');
84+
85+
identify(identifyObj);
86+
87+
trackEvent(AUTH.DISCONNECT_WALLET, {
88+
funnel,
89+
});
90+
}
91+
}, [account, walletType, funnel, trackEvent]);
7992

8093
return (
8194
<>

0 commit comments

Comments
 (0)