mirror of
https://github.com/mue/mue.git
synced 2026-07-05 15:41:18 +02:00
More bug fixes
This commit is contained in:
@@ -43,17 +43,17 @@ export default class Background extends React.PureComponent {
|
||||
const customBackground = localStorage.getItem('customBackground');
|
||||
const favourited = JSON.parse(localStorage.getItem('favourite'));
|
||||
|
||||
if (photoPack) {
|
||||
if (favourited) {
|
||||
this.setBackground(favourited.url, null, 'true');
|
||||
this.setCredit(favourited.credit);
|
||||
document.getElementById('location').textContent = favourited.location;
|
||||
} else if (photoPack) {
|
||||
const randomPhoto = photoPack[Math.floor(Math.random() * photoPack.length)];
|
||||
this.setBackground(randomPhoto.url.default, null, randomPhoto.photographer);
|
||||
this.setCredit(randomPhoto.photographer);
|
||||
document.getElementById('location').textContent = randomPhoto.location;
|
||||
} else if (customBackgroundColour) {
|
||||
this.setBackground(null, customBackgroundColour, 'false');
|
||||
} else if (favourited) {
|
||||
this.setBackground(favourited.url, null, 'true');
|
||||
this.setCredit(favourited.credit);
|
||||
document.getElementById('location').textContent = favourited.location;
|
||||
} else if (customBackground !== '') { // Local
|
||||
this.setBackground(customBackground, null, 'false');
|
||||
} else { // Online
|
||||
|
||||
@@ -35,6 +35,7 @@ export default class Clock extends React.PureComponent {
|
||||
if (localStorage.getItem('24hour') === 'true') {
|
||||
let time = '';
|
||||
if (zero === 'false') time = `${now.getHours()}:${now.getMinutes()}${sec}`;
|
||||
|
||||
else time = `${('00' + now.getHours()).slice(-2)}:${('00' + now.getMinutes()).slice(-2)}${sec}`;
|
||||
this.setState({
|
||||
time: time
|
||||
@@ -51,6 +52,7 @@ export default class Clock extends React.PureComponent {
|
||||
let time = '';
|
||||
if (zero === 'false') time = `${hours}:${now.getMinutes()}${sec}`;
|
||||
else time = `${('00' + hours).slice(-2)}:${('00' + now.getMinutes()).slice(-2)}${sec}`;
|
||||
|
||||
this.setState({
|
||||
time: time,
|
||||
ampm: ampm
|
||||
|
||||
@@ -19,7 +19,7 @@ export default class View extends React.PureComponent {
|
||||
}
|
||||
|
||||
viewStuff() {
|
||||
const elements = ['#searchBar', '.navbar-container', '.clock', '.greeting', '.quotediv'];
|
||||
const elements = ['#searchBar', '.navbar-container', '.clock', '.greeting', '.quotediv', 'time'];
|
||||
elements.forEach((element) => {
|
||||
try {
|
||||
(this.state.hidden === false) ? document.querySelector(element).style.display = 'none' : document.querySelector(element).style.display = 'block';
|
||||
|
||||
@@ -206,4 +206,8 @@ select {
|
||||
|
||||
select#language {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#customBackgroundColour {
|
||||
cursor: pointer;
|
||||
}
|
||||
Reference in New Issue
Block a user