fix: collection refresh and item language display

This commit is contained in:
David Ralph
2022-09-05 13:59:16 +01:00
parent 517091cbda
commit 9c271d1b2a
3 changed files with 3 additions and 5 deletions

View File

@@ -189,7 +189,7 @@ export default class Item extends PureComponent {
</div>
</div>
) : null}
{!this.props.data.data.photos && this.props.data.data.language !== '' ? (
{this.props.data.data.quotes && this.props.data.data.language !== '' ? (
<div className="infoItem">
<MdTranslate />
<div className="text">

View File

@@ -10,7 +10,7 @@ import {
export default function Items({
type,
items,
collections = [],
collection,
toggleFunction,
collectionFunction,
onCollection,
@@ -26,8 +26,6 @@ export default function Items({
}
};
const collection = collections[Math.floor(Math.random() * collections.length)];
return (
<>
{(type === 'all' && !onCollection) || (type === 'collections' && !onCollection) ? (

View File

@@ -402,7 +402,7 @@ export default class Marketplace extends PureComponent {
<Items
type={this.props.type}
items={this.state.items}
collections={this.state.collections}
collection={this.state.collections[Math.floor(Math.random() * this.state.collections.length)] || []}
onCollection={this.state.collection}
toggleFunction={(input) => this.toggle('item', input)}
collectionFunction={(input) => this.toggle('collection', input)}