Skip to content

Commit

Permalink
fix: ledger hid connect metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
manneredboor committed Nov 22, 2024
1 parent 86ba24a commit 9b301d9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@ export const ConnectLedger: FC<ConnectLedgerProps> = (props) => {

const { openModalAsync } = useReefKnotModal();
const metricsOnClick = metrics?.events?.click?.handlers[walletId];
const metricsOnConnect = metrics?.events?.connect?.handlers[walletId];

const handleConnect = useCallback(async () => {
metricsOnClick?.();
const result = await openModalAsync({ type: 'ledger' });
if (result.success) onConnect?.();
}, [openModalAsync, onConnect, metricsOnClick]);
if (result.success) {
onConnect?.();
metricsOnConnect?.();
}
}, [openModalAsync, onConnect, metricsOnClick, metricsOnConnect]);

return (
<ConnectButtonBase
Expand Down

0 comments on commit 9b301d9

Please sign in to comment.