mirror of
https://github.com/mue/mue.git
synced 2026-07-19 06:54:10 +02:00
fix: background hot reload now only reloads when needed
This commit is contained in:
@@ -36,7 +36,7 @@ export default class AdvancedSettings extends React.PureComponent {
|
||||
return (
|
||||
<>
|
||||
<h2>{advanced.title}</h2>
|
||||
<Checkbox name='offlineMode' text={advanced.offline_mode} />
|
||||
<Checkbox name='offlineMode' text={advanced.offline_mode} element='.other' />
|
||||
|
||||
<h3>{advanced.data}</h3>
|
||||
<button className='reset' onClick={() => this.setState({ resetModal: true })}>{this.language.buttons.reset}</button>
|
||||
|
||||
@@ -87,7 +87,7 @@ export default class Background extends React.PureComponent {
|
||||
}
|
||||
|
||||
// preloader for background transition
|
||||
let preloader = document.createElement('img');
|
||||
const preloader = document.createElement('img');
|
||||
preloader.src = url;
|
||||
|
||||
// once image has loaded, add the fade-in transition
|
||||
@@ -269,12 +269,10 @@ export default class Background extends React.PureComponent {
|
||||
|
||||
const backgroundType = localStorage.getItem('backgroundType');
|
||||
|
||||
// todo: make this good
|
||||
if (backgroundType !== this.state.type
|
||||
|| (localStorage.getItem('backgroundAPI') !== this.state.currentAPI && backgroundType === 'api')
|
||||
|| (backgroundType === 'custom' && localStorage.getItem('customBackground') !== this.state.url)
|
||||
) {
|
||||
return refresh();
|
||||
if (this.state.photoInfo.offline !== true) {
|
||||
if (backgroundType !== this.state.type || localStorage.getItem('backgroundAPI') !== this.state.currentAPI || (this.state.type === 'custom' && localStorage.getItem('customBackground') !== this.state.url)) {
|
||||
return refresh();
|
||||
}
|
||||
}
|
||||
|
||||
if (this.state.video === true) {
|
||||
|
||||
Reference in New Issue
Block a user