From f64ea2ac71e6356c038a6a2f3e33b19929b5be88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Guti=C3=A9rrez?= Date: Fri, 22 Mar 2019 13:38:22 +0100 Subject: [PATCH] preventing errors showing not found assets --- client/src/components/molecules/AssetsUser.tsx | 9 ++++++--- client/src/routes/Invoices.tsx | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/client/src/components/molecules/AssetsUser.tsx b/client/src/components/molecules/AssetsUser.tsx index 0ce6039..573723e 100644 --- a/client/src/components/molecules/AssetsUser.tsx +++ b/client/src/components/molecules/AssetsUser.tsx @@ -48,9 +48,12 @@ export default class AssetsUser extends PureComponent { ) : this.state.results.length ? (
- {this.state.results.map((asset, index) => ( - - ))} + {this.state.results + .filter(asset => !!asset) + .map((asset, index) => ( + + )) + }
) : (
diff --git a/client/src/routes/Invoices.tsx b/client/src/routes/Invoices.tsx index 8acd279..eccf36b 100644 --- a/client/src/routes/Invoices.tsx +++ b/client/src/routes/Invoices.tsx @@ -41,9 +41,12 @@ export default class Invoices extends Component<{}, InvoicesState> { public renderResults = () => this.state.results.length ? (
- {this.state.results.map((asset, index) => ( - - ))} + {this.state.results + .filter(asset => !!asset) + .map((asset, index) => ( + + )) + }
) : (
No invoices yet