refactor: cleanup

This commit is contained in:
David Ralph
2021-09-28 23:04:04 +01:00
parent 883f025fbb
commit 80a7b6a56c
58 changed files with 295 additions and 212 deletions

View File

@@ -29,7 +29,7 @@ export default class Background extends PureComponent {
const backgroundImage = document.getElementById('backgroundImage');
if (this.state.url !== '') {
const url = (localStorage.getItem('ddgProxy') === 'true' && this.state.photoInfo.offline !== true && !this.state.url.startsWith('data:')) ? window.constants.DDG_IMAGE_PROXY + this.state.url : this.state.url;
const url = (localStorage.getItem('ddgProxy') === 'true' && this.state.photoInfo.offline !== true && !this.state.url.startsWith('data:')) ? variables.constants.DDG_IMAGE_PROXY + this.state.url : this.state.url;
const photoInformation = document.querySelector('.photoInformation');
// just set the background
@@ -113,14 +113,14 @@ export default class Background extends PureComponent {
let requestURL, data;
switch (backgroundAPI) {
case 'unsplash':
requestURL = `${window.constants.PROXY_URL}/images/unsplash?quality=${apiQuality}&map=${(photoMap === 'true')}`;
requestURL = `${variables.constants.PROXY_URL}/images/unsplash?quality=${apiQuality}&map=${(photoMap === 'true')}`;
break;
case 'pexels':
requestURL = `${window.constants.PROXY_URL}/images/pexels?quality=${apiQuality}`;
requestURL = `${variables.constants.PROXY_URL}/images/pexels?quality=${apiQuality}`;
break;
// Defaults to Mue
default:
requestURL = `${window.constants.API_URL}/images/random?category=${apiCategory}&quality=${apiQuality}`;
requestURL = `${variables.constants.API_URL}/images/random?category=${apiCategory}&quality=${apiQuality}`;
break;
}