mirror of
https://github.com/mue/mue.git
synced 2026-07-11 18:31:47 +02:00
fix: background proxy and offline mode hot reload bugs
This commit is contained in:
@@ -69,7 +69,7 @@ export default class Background extends React.PureComponent {
|
||||
const backgroundImage = document.getElementById('backgroundImage');
|
||||
|
||||
if (this.state.url !== '') {
|
||||
const url = (localStorage.getItem('ddgProxy') === 'true' && this.state.photoInfo.offline !== true) ? 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:')) ? window.constants.DDG_IMAGE_PROXY + this.state.url : this.state.url;
|
||||
const photoInformation = document.querySelector('.photoInformation');
|
||||
|
||||
// just set the background
|
||||
@@ -322,6 +322,10 @@ export default class Background extends React.PureComponent {
|
||||
if (backgroundType !== this.state.type || (this.state.type === 'api' && localStorage.getItem('backgroundAPI') !== this.state.currentAPI) || (this.state.type === 'custom' && localStorage.getItem('customBackground') !== this.state.url)) {
|
||||
return refresh();
|
||||
}
|
||||
} else {
|
||||
if (backgroundType !== this.state.type) {
|
||||
return refresh();
|
||||
}
|
||||
}
|
||||
|
||||
// background effects so we don't get another image again
|
||||
|
||||
@@ -56,7 +56,7 @@ export default function PhotoInformation(props) {
|
||||
setWidth(event.target.width);
|
||||
setHeight(event.target.height);
|
||||
}
|
||||
img.src = props.url;
|
||||
img.src = (localStorage.getItem('ddgProxy') === 'true' && !props.info.offline && !props.url.startsWith('data:')) ? window.constants.DDG_IMAGE_PROXY + props.url : props.url;
|
||||
|
||||
return (
|
||||
<div className='photoInformation'>
|
||||
|
||||
Reference in New Issue
Block a user