From 2715acb2fb8e2d69efe68e8d4e7eaa7d70af9468 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 26 Mar 2019 11:46:57 +0100 Subject: [PATCH] fix user assets listing --- .../organisms/AssetsUser.module.scss | 6 ++++++ .../src/components/organisms/AssetsUser.tsx | 21 ++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/client/src/components/organisms/AssetsUser.module.scss b/client/src/components/organisms/AssetsUser.module.scss index ec2d705..30f2798 100644 --- a/client/src/components/organisms/AssetsUser.module.scss +++ b/client/src/components/organisms/AssetsUser.module.scss @@ -17,3 +17,9 @@ display: block; margin-top: $spacer / 2; } + +.empty { + text-align: center; + margin-top: $spacer; + color: $brand-grey-light; +} diff --git a/client/src/components/organisms/AssetsUser.tsx b/client/src/components/organisms/AssetsUser.tsx index a38adb2..6f22513 100644 --- a/client/src/components/organisms/AssetsUser.tsx +++ b/client/src/components/organisms/AssetsUser.tsx @@ -17,6 +17,7 @@ export default class AssetsUser extends PureComponent< } private async searchOcean() { + if (this.context.account) { this.context.ocean.keeper.didRegistry.contract.getPastEvents( 'DIDAttributeRegistered', { @@ -35,19 +36,25 @@ export default class AssetsUser extends PureComponent< `did:op:${event.returnValues._did.substring(2)}` ) results.push(ddo) + } + this.setState({ results, isLoading: false }) } - this.setState({ results, isLoading: false }) } - } - ) + ) + } + + this.setState({ isLoading: false }) } public render() { return ( -
- {this.props.recent && ( -

Your Latest Data Sets

- )} + this.context.account && ( +
+ {this.props.recent && ( +

+ Your Latest Data Sets +

+ )} {this.state.isLoading ? (