Skip to content

Commit

Permalink
Merge pull request #1469 from decentdao/maintenance/#1468-fix-sentry-…
Browse files Browse the repository at this point in the history
…init

Maintenance/#1468 fix sentry init
  • Loading branch information
adamgall authored Mar 19, 2024
2 parents 5473d19 + 5c5b336 commit 55ffe62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/helpers/errorLogging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 2 additions & 6 deletions src/providers/Providers.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<ChakraProvider
theme={theme}
Expand Down

0 comments on commit 55ffe62

Please sign in to comment.