refactor and fix some things

This commit is contained in:
David Ralph
2021-01-16 18:39:03 +00:00
parent 5c579ee0a2
commit 0a735384df
23 changed files with 122 additions and 117 deletions

View File

@@ -22,8 +22,10 @@ export default class Clock extends React.PureComponent {
if (localStorage.getItem('percentageComplete') === 'true') return this.setState({ time: (now.getHours() / 24).toFixed(2).replace('0.', '') + '%'});
// Analog clock
if (localStorage.getItem('analog') === 'true') this.setState({ time: now });
else {
if (localStorage.getItem('analog') === 'true') {
require('react-clock/dist/Clock.css');
this.setState({ time: now });
} else {
let time, sec = '';
// Extra 0

View File

@@ -11,6 +11,7 @@ export default class DateWidget extends React.PureComponent {
getDate() {
const date = new Date();
const short = localStorage.getItem('short');
const dateFormat = localStorage.getItem('dateFormat');
@@ -54,7 +55,6 @@ export default class DateWidget extends React.PureComponent {
}
componentDidMount() {
if (localStorage.getItem('date') === 'false') return;
this.getDate();
}