2023-10-16 14:49:23 +00:00
|
|
|
import { useEnvironment } from '@vegaprotocol/environment';
|
2024-03-01 14:25:56 +00:00
|
|
|
import { useEagerConnect as useVegaEagerConnect } from '@vegaprotocol/wallet-react';
|
2023-10-16 14:49:23 +00:00
|
|
|
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 } : {}
|
|
|
|
);
|
2024-03-01 14:25:56 +00:00
|
|
|
useVegaEagerConnect();
|
2023-10-16 14:49:23 +00:00
|
|
|
|
|
|
|
return null;
|
|
|
|
};
|