fix: remove sentry (#520)

This commit is contained in:
Adam Uhlíř
2022-08-08 18:19:38 +02:00
committed by GitHub
parent e986d7ca22
commit 0260df61de
10 changed files with 9 additions and 394 deletions
+4 -19
View File
@@ -7,9 +7,6 @@ import ErrorBoundary from '../components/ErrorBoundary'
import SideBar from '../components/SideBar'
import { Context as BeeContext } from '../providers/Bee'
import { Context as SettingsContext } from '../providers/Settings'
import config from '../config'
import * as Sentry from '@sentry/react'
import ItsBroken from './ItsBroken'
import { useNewBeeDesktopVersion } from '../hooks/apiHooks'
import { BEE_DESKTOP_LATEST_RELEASE_PAGE } from '../utils/desktop'
@@ -117,25 +114,13 @@ const Dashboard = (props: Props): ReactElement => {
</>
)
let errorBoundaryWithContent
if (config.SENTRY_KEY) {
errorBoundaryWithContent = (
<Sentry.ErrorBoundary
showDialog
fallback={({ error, componentStack, resetError }) => <ItsBroken message={error.message} />}
>
{content}
</Sentry.ErrorBoundary>
)
} else {
errorBoundaryWithContent = <ErrorBoundary>{content}</ErrorBoundary>
}
return (
<div style={{ display: 'flex' }}>
<SideBar />
<Container className={classes.content}>{errorBoundaryWithContent}</Container>
<Container className={classes.content}>
{' '}
<ErrorBoundary>{content}</ErrorBoundary>
</Container>
</div>
)
}
-36
View File
@@ -1,36 +0,0 @@
import { Container } from '@material-ui/core'
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'
import { ReactElement } from 'react'
const useStyles = makeStyles((theme: Theme) =>
createStyles({
content: {
backgroundColor: theme.palette.background.default,
minHeight: '100vh',
textAlign: 'center',
},
errorMsg: {
marginTop: '30px',
},
}),
)
interface Props {
message: string
}
// TODO: Provide some nicer design
const ItsBroken = ({ message }: Props): ReactElement => {
const classes = useStyles()
return (
<div>
<Container className={classes.content}>
<h1>Ups, there was a problem 😅</h1>
<h3 className={classes.errorMsg}>Error: {message}</h3>
</Container>
</div>
)
}
export default ItsBroken