1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

preventing errors showing not found assets

This commit is contained in:
Pedro Gutiérrez 2019-03-22 13:38:22 +01:00
parent b823078bab
commit f64ea2ac71
2 changed files with 12 additions and 6 deletions

View File

@ -48,9 +48,12 @@ export default class AssetsUser extends PureComponent {
<Spinner />
) : this.state.results.length ? (
<div className={styles.assets}>
{this.state.results.map((asset, index) => (
<Asset key={index} asset={asset} />
))}
{this.state.results
.filter(asset => !!asset)
.map((asset, index) => (
<Asset key={index} asset={asset} />
))
}
</div>
) : (
<div>

View File

@ -41,9 +41,12 @@ export default class Invoices extends Component<{}, InvoicesState> {
public renderResults = () =>
this.state.results.length ? (
<div className={styles.results}>
{this.state.results.map((asset, index) => (
<Asset key={index} asset={asset} />
))}
{this.state.results
.filter(asset => !!asset)
.map((asset, index) => (
<Asset key={index} asset={asset} />
))
}
</div>
) : (
<div>No invoices yet</div>