fix: translations

Co-authored-by: David Ralph <me@davidcralph.co.uk>
This commit is contained in:
alexsparkes
2023-03-16 15:44:51 +00:00
parent 166926e174
commit 59c132875f
5 changed files with 36 additions and 7 deletions

View File

@@ -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) {

View File

@@ -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')}