diff --git a/package.json b/package.json index 8b3b08a9..987c7076 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@fontsource/lexend-deca": "4.4.5", "@fontsource/montserrat": "4.4.5", "@mui/material": "5.6.0", + "@sentry/react": "^6.19.6", "react": "^18.0.0", "react-clock": "3.1.0", "react-color-gradient-picker": "0.1.2", diff --git a/src/components/modals/ErrorBoundary.jsx b/src/components/modals/ErrorBoundary.jsx index 7ba750d8..a7f4679b 100644 --- a/src/components/modals/ErrorBoundary.jsx +++ b/src/components/modals/ErrorBoundary.jsx @@ -1,12 +1,15 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; import { MdErrorOutline } from 'react-icons/md'; +import { captureException } from '@sentry/react'; export default class ErrorBoundary extends PureComponent { constructor(props) { super(props); this.state = { error: false, + errorData: '', + showReport: true }; } @@ -15,9 +18,17 @@ export default class ErrorBoundary extends PureComponent { variables.stats.postEvent('modal', 'Error occurred'); return { error: true, + errorData: error }; } + reportError() { + captureException(this.state.errorData); + this.setState({ + showReport: false + }) + } + render() { if (this.state.error) { return ( @@ -36,6 +47,9 @@ export default class ErrorBoundary extends PureComponent { 'modals.main.error_boundary.message', )}

+ {this.state.showReport ? : } */} -
+
Drop to upload diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index 8557a7e3..e0e60479 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -103,6 +103,13 @@ export default class Quote extends PureComponent { } async getAuthorImg(author) { + if (localStorage.getItem('authorImg') === 'false') { + return { + authorimg: null, + authorimglicense: null + } + } + const authorimgdata = await ( await fetch( `https://en.wikipedia.org/w/api.php?action=query&titles=${author}&origin=*&prop=pageimages&format=json&pithumbsize=100`, @@ -438,7 +445,7 @@ export default class Quote extends PureComponent { {this.state.authorimglicense}
- {this.state.authorOccupation !== 'Unknown' ? ( + {this.state.authorOccupation !== 'Unknown' && this.state.authorlink !== '' ? ( , document.getElementById('root')); diff --git a/src/modules/constants.js b/src/modules/constants.js index a6ae4e39..13aad0d1 100644 --- a/src/modules/constants.js +++ b/src/modules/constants.js @@ -18,6 +18,7 @@ export const REPORT_ITEM = export const BUG_REPORT = 'https://github.com/mue/mue/issues/new?assignees=&labels=issue+report&template=bug-report.md&title=%5BBug%5D+'; export const DONATE_LINK = 'https://muetab.com/donate'; +export const SENTRY_DSN = 'https://430352fd4b174d688ebd82fc85c22c58@o1217438.ingest.sentry.io/6359480'; // Mue Info export const ORG_NAME = 'mue';