mue/src/App.jsx

46 lines
1.4 KiB
React
Raw Normal View History

2019-09-29 16:46:53 +00:00
import React from 'react';
2020-09-14 19:48:58 +00:00
2020-11-29 14:32:08 +00:00
import Background from './components/widgets/background/Background';
2021-01-16 18:39:03 +00:00
import Widgets from './components/widgets/Widgets';
2021-03-20 12:55:20 +00:00
import Modals from './components/modals/Modals';
2020-09-14 19:48:58 +00:00
import EventBus from './modules/helpers/eventbus';
2020-11-28 13:24:40 +00:00
import SettingsFunctions from './modules/helpers/settings';
import { ToastContainer } from 'react-toastify';
export default class App extends React.PureComponent {
componentDidMount() {
2021-04-17 20:38:16 +00:00
// 4.0 -> 5.0 (the key below is only on 5.0)
// now featuring 5.0 -> 5.1
// the firstRun check was moved here because the old function was useless
if (!localStorage.getItem('firstRun') || !localStorage.getItem('stats')) {
2021-04-17 20:38:16 +00:00
SettingsFunctions.moveSettings();
window.location.reload();
}
SettingsFunctions.loadSettings();
EventBus.on('refresh', (data) => {
if (data === 'other') {
SettingsFunctions.loadSettings(true);
}
});
2021-06-21 16:42:14 +00:00
window.stats.tabLoad();
2020-11-04 12:19:12 +00:00
}
render() {
2019-09-29 16:46:53 +00:00
return (
<>
2021-04-13 19:27:56 +00:00
{(localStorage.getItem('background') === 'true') ? <Background/> : null}
2021-03-23 13:10:34 +00:00
<ToastContainer position='bottom-right' autoClose={localStorage.getItem('toastDisplayTime') || 2500} newestOnTop={true} closeOnClick pauseOnFocusLoss/>
<div id='center'>
<Widgets/>
2021-03-20 12:55:20 +00:00
<Modals/>
</div>
</>
2019-09-29 16:46:53 +00:00
);
}
}