diff --git a/src/components/modals/Addons.jsx b/src/components/modals/Addons.jsx index 99b37fdd..8f2a0ede 100644 --- a/src/components/modals/Addons.jsx +++ b/src/components/modals/Addons.jsx @@ -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 = ; - this.setState({ button: button }); + this.setState({ + button: button, + installed: JSON.parse(localStorage.getItem('installed')) + }); } switch (input.type) { diff --git a/src/components/widgets/Background.jsx b/src/components/widgets/Background.jsx index a06c3916..0c1176ea 100644 --- a/src/components/widgets/Background.jsx +++ b/src/components/widgets/Background.jsx @@ -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) {