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
|
|
|
|
2021-04-12 19:35:17 +00:00
|
|
|
import EventBus from './modules/helpers/eventbus';
|
2020-11-28 13:24:40 +00:00
|
|
|
import SettingsFunctions from './modules/helpers/settings';
|
2021-04-12 17:55:02 +00:00
|
|
|
|
2020-08-10 18:49:46 +00:00
|
|
|
import { ToastContainer } from 'react-toastify';
|
2020-07-18 21:00:34 +00:00
|
|
|
|
2020-08-10 18:49:46 +00:00
|
|
|
export default class App extends React.PureComponent {
|
2020-10-17 17:46:27 +00:00
|
|
|
componentDidMount() {
|
2021-04-17 20:38:16 +00:00
|
|
|
// 4.0 -> 5.0 (the key below is only on 5.0)
|
2021-06-20 12:09:41 +00:00
|
|
|
// now featuring 5.0 -> 5.1
|
2021-07-02 20:29:33 +00:00
|
|
|
// the firstRun check was moved here because the old function was useless
|
2021-07-06 18:38:20 +00:00
|
|
|
if (!localStorage.getItem('firstRun') || !localStorage.getItem('stats')) {
|
2021-04-17 20:38:16 +00:00
|
|
|
SettingsFunctions.moveSettings();
|
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
|
2021-02-26 22:46:07 +00:00
|
|
|
SettingsFunctions.loadSettings();
|
2021-04-12 19:35:17 +00:00
|
|
|
|
|
|
|
EventBus.on('refresh', (data) => {
|
|
|
|
if (data === 'other') {
|
|
|
|
SettingsFunctions.loadSettings(true);
|
|
|
|
}
|
|
|
|
});
|
2021-06-21 16:42:14 +00:00
|
|
|
|
2021-06-30 10:27:54 +00:00
|
|
|
window.stats.tabLoad();
|
2020-11-04 12:19:12 +00:00
|
|
|
}
|
|
|
|
|
2020-10-17 17:46:27 +00:00
|
|
|
render() {
|
2019-09-29 16:46:53 +00:00
|
|
|
return (
|
2021-03-22 22:17:52 +00:00
|
|
|
<>
|
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/>
|
2020-07-15 20:06:21 +00:00
|
|
|
<div id='center'>
|
2021-03-19 22:30:29 +00:00
|
|
|
<Widgets/>
|
2021-03-20 12:55:20 +00:00
|
|
|
<Modals/>
|
2020-07-15 20:06:21 +00:00
|
|
|
</div>
|
2021-03-22 22:17:52 +00:00
|
|
|
</>
|
2019-09-29 16:46:53 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|