We're sorry for the interruption. If the problem persists, please reach out to our support team. You
may also try to
import PropTypes from 'prop-types'; import React from 'react'; import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { NODE_ENV } from 'soapbox/build_config'; import { Text, Stack } from 'soapbox/components/ui'; import { captureException } from 'soapbox/monitoring'; import sourceCode from 'soapbox/utils/code'; import { getSoapboxConfig } from '../actions/soapbox'; const mapStateToProps = (state) => { const soapboxConfig = getSoapboxConfig(state); return { siteTitle: state.instance.title, helpLink: soapboxConfig.getIn(['links', 'help']), supportLink: soapboxConfig.getIn(['links', 'support']), statusLink: soapboxConfig.getIn(['links', 'status']), }; }; @connect(mapStateToProps) class ErrorBoundary extends React.PureComponent { static propTypes = { children: PropTypes.node, siteTitle: PropTypes.string, supportLink: PropTypes.string, helpLink: PropTypes.string, statusLink: PropTypes.string, }; state = { hasError: false, componentStack: undefined, } componentDidCatch(error, info) { captureException(error); this.setState({ hasError: true, error, componentStack: info && info.componentStack, }); import(/* webpackChunkName: "error" */'bowser') .then(({ default: Bowser }) => { this.setState({ browser: Bowser.getParser(window.navigator.userAgent), }); }) .catch(() => {}); } setTextareaRef = c => { this.textarea = c; } handleCopy = e => { if (!this.textarea) return; this.textarea.select(); this.textarea.setSelectionRange(0, 99999); document.execCommand('copy'); } getErrorText = () => { const { error, componentStack } = this.state; return error + componentStack; } clearCookies = e => { localStorage.clear(); sessionStorage.clear(); } render() { const { browser, hasError } = this.state; const { children, siteTitle, helpLink, statusLink, supportLink } = this.props; if (!hasError) { return children; } const isProduction = NODE_ENV === 'production'; const errorText = this.getErrorText(); return (
We're sorry for the interruption. If the problem persists, please reach out to our support team. You
may also try to