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

fix user assets listing

This commit is contained in:
Matthias Kretschmann 2019-03-26 11:46:57 +01:00
parent 4977b28f1b
commit 2715acb2fb
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 20 additions and 7 deletions

View File

@ -17,3 +17,9 @@
display: block;
margin-top: $spacer / 2;
}
.empty {
text-align: center;
margin-top: $spacer;
color: $brand-grey-light;
}

View File

@ -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 (
<div className={styles.assetsUser}>
{this.props.recent && (
<h2 className={styles.subTitle}>Your Latest Data Sets</h2>
)}
this.context.account && (
<div className={styles.assetsUser}>
{this.props.recent && (
<h2 className={styles.subTitle}>
Your Latest Data Sets
</h2>
)}
{this.state.isLoading ? (
<Spinner />