vega-frontend-monorepo/apps/trading/pages/maybe-connect-eagerly.tsx
Matthew Russell 28b4593a1d
refactor(trading,governance,wallet): wallet rewrite (#5815)
Co-authored-by: bwallacee <ben@vega.xyz>
2024-03-01 14:25:56 +00:00

16 lines
597 B
TypeScript

import { useEnvironment } from '@vegaprotocol/environment';
import { useEagerConnect as useVegaEagerConnect } from '@vegaprotocol/wallet-react';
import { useEagerConnect as useEthereumEagerConnect } from '@vegaprotocol/web3';
import { useTelemetryApproval } from '../lib/hooks/use-telemetry-approval';
export const MaybeConnectEagerly = () => {
const { VEGA_ENV, SENTRY_DSN } = useEnvironment();
const [isTelemetryApproved] = useTelemetryApproval();
useEthereumEagerConnect(
isTelemetryApproved ? { dsn: SENTRY_DSN, env: VEGA_ENV } : {}
);
useVegaEagerConnect();
return null;
};