mirror of
https://github.com/mue/mue.git
synced 2026-07-18 22:44:08 +02:00
feat: add work in progress 7.0 code
Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
@@ -6,27 +6,42 @@ export default class ErrorBoundary extends PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
error: false
|
||||
error: false,
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromError(error) {
|
||||
console.log(error);
|
||||
variables.stats.postEvent('modal', 'Error occurred');
|
||||
return {
|
||||
error: true
|
||||
return {
|
||||
error: true,
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.error) {
|
||||
return (
|
||||
<div className='emptyitems'>
|
||||
<div className='emptyMessage'>
|
||||
<MdErrorOutline/>
|
||||
<h1>{variables.language.getMessage(variables.languagecode, 'modals.main.error_boundary.title')}</h1>
|
||||
<p>{variables.language.getMessage(variables.languagecode, 'modals.main.error_boundary.message')}</p>
|
||||
<button className='refresh' onClick={() => window.location.reload()}>{variables.language.getMessage(variables.languagecode, 'modals.main.error_boundary.refresh')}</button>
|
||||
<div className="emptyItems">
|
||||
<div className="emptyMessage">
|
||||
<MdErrorOutline />
|
||||
<h1>
|
||||
{variables.language.getMessage(
|
||||
variables.languagecode,
|
||||
'modals.main.error_boundary.title',
|
||||
)}
|
||||
</h1>
|
||||
<p>
|
||||
{variables.language.getMessage(
|
||||
variables.languagecode,
|
||||
'modals.main.error_boundary.message',
|
||||
)}
|
||||
</p>
|
||||
<button className="refresh" onClick={() => window.location.reload()}>
|
||||
{variables.language.getMessage(
|
||||
variables.languagecode,
|
||||
'modals.main.error_boundary.refresh',
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user