diff --git a/src/helpers/errorLogging.ts b/src/helpers/errorLogging.ts index a5d66005f7..0306b12caa 100644 --- a/src/helpers/errorLogging.ts +++ b/src/helpers/errorLogging.ts @@ -3,7 +3,7 @@ import * as Sentry from '@sentry/react'; /** * Initializes error logging. */ -export function initErrorLogging() { +function initErrorLogging() { if ( process.env.NODE_ENV === 'development' || import.meta.env.VITE_APP_SENTRY_DSN_URL === undefined @@ -27,6 +27,8 @@ export function initErrorLogging() { }); } +initErrorLogging(); + /** * Logs an error to Sentry and the console. * @param error the error to log. Strings are logged on Sentry as "messages", anything diff --git a/src/providers/Providers.tsx b/src/providers/Providers.tsx index 223e8c29e5..1f54fd8e60 100644 --- a/src/providers/Providers.tsx +++ b/src/providers/Providers.tsx @@ -1,23 +1,19 @@ import { ApolloProvider } from '@apollo/client'; import { ChakraProvider } from '@chakra-ui/react'; import { RainbowKitProvider, midnightTheme } from '@rainbow-me/rainbowkit'; -import { ReactNode, useEffect } from 'react'; +import { ReactNode } from 'react'; import { ToastContainer } from 'react-toastify'; import { WagmiConfig } from 'wagmi'; import { theme } from '../assets/theme'; import { ErrorFallback } from '../components/ui/utils/ErrorFallback'; import graphQLClient from '../graphql'; -import { FractalErrorBoundary, initErrorLogging } from '../helpers/errorLogging'; +import { FractalErrorBoundary } from '../helpers/errorLogging'; import { AppProvider } from './App/AppProvider'; import EthersContextProvider from './Ethers'; import { NetworkConfigProvider } from './NetworkConfig/NetworkConfigProvider'; import { wagmiConfig, chains } from './NetworkConfig/rainbow-kit.config'; export default function Providers({ children }: { children: ReactNode }) { - useEffect(() => { - initErrorLogging(); - }, []); - return (