mirror of
https://github.com/mue/mue.git
synced 2026-07-14 12:34:03 +02:00
@@ -10,7 +10,7 @@ import {
|
||||
} from '@mui/material';
|
||||
|
||||
import EventBus from 'modules/helpers/eventbus';
|
||||
import translations from 'modules/translations';
|
||||
import { translations } from 'modules/translations';
|
||||
|
||||
class Radio extends PureComponent {
|
||||
constructor(props) {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/* eslint-disable array-callback-return */
|
||||
import variables from 'modules/variables';
|
||||
import { PureComponent } from 'preact/compat';
|
||||
import { MdShowChart } from 'react-icons/md';
|
||||
import { MdShowChart, MdRestartAlt } from 'react-icons/md';
|
||||
import { FaTrophy } from 'react-icons/fa';
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
import achievementsData from 'modules/helpers/settings/achievements.json';
|
||||
import translations from 'modules/helpers/settings/achievement_translations/index';
|
||||
@@ -66,6 +67,16 @@ export default class Stats extends PureComponent {
|
||||
return count;
|
||||
}
|
||||
|
||||
resetStats() {
|
||||
localStorage.setItem('statsData', JSON.stringify({}));
|
||||
this.setState({
|
||||
stats: {},
|
||||
});
|
||||
toast.success('Stats reset');
|
||||
this.getAchievements();
|
||||
this.forceUpdate();
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getAchievements();
|
||||
this.forceUpdate();
|
||||
@@ -167,6 +178,9 @@ export default class Stats extends PureComponent {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="statsReset">
|
||||
<button onClick={() => this.resetStats()}><MdRestartAlt /> {variables.getMessage('modals.main.settings.buttons.reset')}</button>
|
||||
</div>
|
||||
<div className="statSection leftPanel">
|
||||
<span className="title">
|
||||
{variables.getMessage('modals.main.settings.sections.stats.achievements')}
|
||||
|
||||
Reference in New Issue
Block a user