mirror of
https://github.com/mue/mue.git
synced 2026-07-15 13:03:55 +02:00
bug fixes
This commit is contained in:
@@ -168,7 +168,7 @@ export default class Settings extends React.PureComponent {
|
||||
<div className='section'>
|
||||
<h4 onClick={() => SettingsFunctions.toggleExtra(document.getElementsByClassName('extraSettings')[3], document.getElementsByClassName('expandIcons')[3])}>{this.props.language.background.title}</h4>
|
||||
<ExpandMore style={{ 'transition': 'all 0.5s ease 0s' }} className='expandIcons' onClick={() => SettingsFunctions.toggleExtra(document.getElementsByClassName('extraSettings')[3], document.getElementsByClassName('expandIcons')[3])} />
|
||||
<Slider name='background' override='customBackground' />
|
||||
<Slider name='background' />
|
||||
<li className='extraSettings'>
|
||||
<ul>
|
||||
<label htmlFor='8'>{this.props.language.background.API} </label>
|
||||
|
||||
@@ -50,10 +50,9 @@ export default class Background extends React.PureComponent {
|
||||
try { // First we try and get an image from the API...
|
||||
let requestURL;
|
||||
const enabled = localStorage.getItem('webp');
|
||||
const backgroundAPI = localStorage.getItem('backgroundAPI');
|
||||
let data;
|
||||
|
||||
switch (backgroundAPI) {
|
||||
switch (localStorage.getItem('backgroundAPI')) {
|
||||
case 'mue':
|
||||
if (await supportsWebP && enabled === 'true') requestURL = Constants.API_URL + '/getImage?webp=true';
|
||||
else requestURL = Constants.API_URL + '/getImage?category=Outdoors';
|
||||
@@ -73,7 +72,8 @@ export default class Background extends React.PureComponent {
|
||||
document.getElementById('backgroundImage').setAttribute('style', `-webkit-filter:blur(${localStorage.getItem('blur')}px); background-image: url(${data.file})`); // Set background and blur etc
|
||||
let credit = document.getElementById('photographer');
|
||||
credit.innerText = `${credit.innerText} ${data.photographer}`; // Set the credit
|
||||
document.getElementById('location').innerText = `${data.location}`; // Set the location tooltip
|
||||
if (data.location.replace(/[null]+/g, '') === ' ') return document.getElementById('backgroundCredits').style.display = 'none';
|
||||
document.getElementById('location').innerText = `${data.location.replace('null', '')}`; // Set the location tooltip
|
||||
} catch (e) { // ..and if that fails we load one locally
|
||||
this.doOffline();
|
||||
}
|
||||
@@ -81,7 +81,10 @@ export default class Background extends React.PureComponent {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
if (localStorage.getItem('background') === 'false') return document.getElementById('backgroundCredits').style.display = 'none';
|
||||
if (localStorage.getItem('background') === 'false') {
|
||||
document.getElementById('photographer').style.display = 'none';
|
||||
return document.getElementById('backgroundCredits').style.display = 'none';
|
||||
}
|
||||
if (localStorage.getItem('animations') === 'true') document.getElementById('backgroundImage').classList.add('fade-in');
|
||||
this.setBackground();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user