import React, { PureComponent } from 'react'; import { captureException } from '@sentry/react'; class ErrorBoundary extends PureComponent { constructor(props) { super(props); this.state = { error: false, errorData: '', showReport: true, }; } componentDidCatch(error, errorInfo) { this.setState({ error: true, errorData: errorInfo }); console.error('Error boundary caught an error:', error, errorInfo); } reportError() { captureException(this.state.errorData); this.setState({ showReport: false, }); } render() { if (this.state.error) { return (

A critical error has occurred

The new tab page could not be loaded. Please uninstall the extension and try again.

{this.state.showReport ? ( ) : (

Sent Successfully

)} Support Discord
); } return this.props.children; } } export default ErrorBoundary;