Skip to content

Commit

Permalink
fix: remove sentry (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau authored Aug 8, 2022
1 parent e986d7c commit 0260df6
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 394 deletions.
168 changes: 2 additions & 166 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
"@material-ui/core": "4.12.3",
"@material-ui/icons": "4.11.2",
"@material-ui/lab": "4.0.0-alpha.57",
"@sentry/react": "^7.1.1",
"@sentry/tracing": "^7.1.1",
"assert": "^2.0.0",
"axios": "0.24.0",
"bignumber.js": "9.0.1",
Expand Down Expand Up @@ -162,4 +160,4 @@
"npm": ">=6.9.0",
"bee": ">=0.6.0"
}
}
}
21 changes: 0 additions & 21 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ThemeProvider } from '@material-ui/core/styles'
import { SnackbarProvider } from 'notistack'
import React, { ReactElement } from 'react'
import { HashRouter as Router } from 'react-router-dom'
import * as Sentry from '@sentry/react'
import './App.css'
import Dashboard from './layout/Dashboard'
import { Provider as BeeProvider } from './providers/Bee'
Expand All @@ -16,9 +15,6 @@ import { Provider as TopUpProvider } from './providers/TopUp'
import { Provider as BalanceProvider } from './providers/WalletBalance'
import BaseRouter from './routes'
import { theme } from './theme'
import { config } from './config'
import ItsBroken from './layout/ItsBroken'
import { initSentry } from './utils/sentry'

interface Props {
beeApiUrl?: string
Expand All @@ -27,11 +23,6 @@ interface Props {
isBeeDesktop?: boolean
}

if (config.SENTRY_KEY) {
// eslint-disable-next-line no-console
initSentry().catch(e => console.error(e))
}

const App = ({ beeApiUrl, beeDebugApiUrl, lockedApiSettings, isBeeDesktop }: Props): ReactElement => {
const mainApp = (
<div className="App">
Expand Down Expand Up @@ -71,18 +62,6 @@ const App = ({ beeApiUrl, beeDebugApiUrl, lockedApiSettings, isBeeDesktop }: Pro
</div>
)

// Displays Report Dialog when some component crashes
if (config.SENTRY_KEY) {
return (
<Sentry.ErrorBoundary
showDialog
fallback={({ error, componentStack, resetError }) => <ItsBroken message={error.message} />}
>
{mainApp}
</Sentry.ErrorBoundary>
)
}

return mainApp
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, ErrorInfo, ReactElement } from 'react'
import ItsBroken from '../layout/ItsBroken'

interface Props {
children: ReactElement
Expand Down Expand Up @@ -27,7 +26,8 @@ export default class ErrorBoundary extends Component<Props, State> {

render(): ReactElement {
if (this.state.error) {
return <ItsBroken message={this.state.error.message} />
// You can render any custom fallback UI
return <h1>Something went wrong. Error: {this.state.error.message}</h1>
}

return this.props.children
Expand Down
95 changes: 0 additions & 95 deletions src/components/Feedback.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/components/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import DashboardLogo from '../assets/dashboard-logo.svg'
import DesktopLogo from '../assets/desktop-logo.svg'
import { config } from '../config'
import { ROUTES } from '../routes'
import Feedback from './Feedback'
import SideBarItem from './SideBarItem'
import SideBarStatus from './SideBarStatus'
import { BeeModes } from '@ethersphere/bee-js'
Expand Down Expand Up @@ -133,7 +132,6 @@ export default function SideBar(): ReactElement {
<Link to={ROUTES.STATUS} className={classes.link}>
<SideBarStatus path={ROUTES.STATUS} />
</Link>
<Feedback />
</List>
</Grid>
</Grid>
Expand Down
Loading

0 comments on commit 0260df6

Please sign in to comment.