fix: various bug fixes for background and marketplace

This commit is contained in:
David Ralph
2021-05-02 17:10:20 +01:00
parent 5ea158c21d
commit f21ee5c5ba
11 changed files with 12 additions and 10 deletions

View File

@@ -202,6 +202,7 @@ export default class Marketplace extends React.PureComponent {
<option value='a-z'>{window.language.modals.main.addons.sort.a_z}</option>
<option value='z-a'>{window.language.modals.main.addons.sort.z_a}</option>
</Dropdown>
<br/>
<Items items={this.state.items} toggleFunction={(input) => this.toggle('item', input)} />
</div>
<Item data={this.state.item} button={this.state.button} toggleFunction={() => this.toggle()} display={this.state.display.item} />

View File

@@ -233,6 +233,7 @@ export default class Background extends React.PureComponent {
const photoLocation = randomPhoto.location.replace(/[null]+/g, '');
return this.setState({
url: randomPhoto.url.default,
type: 'photo_pack',
photoInfo: {
hidden: false,
credit: randomPhoto.photographer,
@@ -295,7 +296,7 @@ export default class Background extends React.PureComponent {
if (this.state.photoInfo.offline !== true) {
// basically check to make sure something has changed before we try getting another background
if (backgroundType !== this.state.type || localStorage.getItem('backgroundAPI') !== this.state.currentAPI || (this.state.type === 'custom' && localStorage.getItem('customBackground') !== this.state.url)) {
if (backgroundType !== this.state.type || (this.state.type === 'api' && localStorage.getItem('backgroundAPI') !== this.state.currentAPI) || (this.state.type === 'custom' && localStorage.getItem('customBackground') !== this.state.url)) {
return refresh();
}
}