fix: some bug fixes

This commit is contained in:
David Ralph
2021-04-21 19:35:33 +01:00
parent 9b43063935
commit 51d0715f0f
22 changed files with 49 additions and 38 deletions

View File

@@ -30,18 +30,12 @@ export default class BackgroundSettings extends React.PureComponent {
this.setState({
customBackground: ''
});
toast(this.language.toasts.reset);
toast(window.language.toasts.reset);
EventBus.dispatch('refresh', 'background');
}
customBackground(e, text) {
let result;
if (text === true) {
result = e.target.value;
} else {
result = e.target.result;
}
const result = (text === true) ? e.target.value : e.target.result;
localStorage.setItem('customBackground', result);
this.setState({
customBackground: result
@@ -83,6 +77,10 @@ export default class BackgroundSettings extends React.PureComponent {
}
componentDidMount() {
if (navigator.onLine === false || localStorage.getItem('offlineMode') === 'true') {
return;
}
this.getBackgroundCategories();
}