bug fixes

This commit is contained in:
David Ralph
2020-09-18 09:39:02 +01:00
parent 97a76bd0d7
commit c858734d7f
2 changed files with 9 additions and 3 deletions

View File

@@ -54,7 +54,8 @@ export default class Addons extends React.PureComponent {
MarketplaceFunctions.uninstall(this.state.current_data.name, this.state.current_data.type);
toast(this.props.toastLanguage.removed);
this.setState({
button: ''
button: '',
installed: JSON.parse(localStorage.getItem('installed'))
});
}
@@ -72,7 +73,10 @@ export default class Addons extends React.PureComponent {
localStorage.setItem('installed', JSON.stringify(installed));
toast(this.props.toastLanguage.installed);
button = <button className='removeFromMue' onClick={() => this.uninstall()}>{this.props.marketplaceLanguage.product.buttons.remove}</button>;
this.setState({ button: button });
this.setState({
button: button,
installed: JSON.parse(localStorage.getItem('installed'))
});
}
switch (input.type) {

View File

@@ -45,7 +45,9 @@ export default class Background extends React.PureComponent {
if (photoPack) {
const randomPhoto = photoPack[Math.floor(Math.random() * photoPack.length)];
this.setBackground(randomPhoto.url.default);
this.setBackground(randomPhoto.url.default, null, randomPhoto.photographer);
this.setCredit(randomPhoto.photographer);
document.getElementById('location').textContent = randomPhoto.location;
} else if (customBackgroundColour) {
this.setBackground(null, customBackgroundColour, 'false');
} else if (favourited) {