fix: experimental fix for interval

This commit is contained in:
alexsparkes
2022-09-11 11:40:13 +01:00
parent 0ab4c4b63d
commit 2cf00168eb
2 changed files with 6 additions and 21 deletions

View File

@@ -22,6 +22,7 @@ export default class Background extends PureComponent {
style: '',
url: '',
currentAPI: '',
firstTime: false,
photoInfo: {
hidden: false,
offline: false,
@@ -408,7 +409,6 @@ export default class Background extends PureComponent {
this.getBackground();
localStorage.setItem('backgroundStartTime', Date.now());
} else {
console.log('Or this?');
try {
const current = JSON.parse(localStorage.getItem('currentBackground'));
if (current.type !== type) {
@@ -416,11 +416,15 @@ export default class Background extends PureComponent {
}
const offline = localStorage.getItem('offlineMode');
if (current.url.startsWith('http') && offline === 'false') {
console.log('current.url one?')
this.setState(current);
} else if (current.url.startsWith('http')) {
this.setState(offlineBackground());
}
this.setState(current);
if (this.state.firstTime !== true) {
this.setState(current);
}
this.setState({ firstTime: true })
} catch (e) {
this.setBackground();
}