28b4593a1d
Co-authored-by: bwallacee <ben@vega.xyz>
16 lines
597 B
TypeScript
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;
|
|
};
|