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

merge fix

This commit is contained in:
Matthias Kretschmann 2019-03-28 13:15:26 +01:00
parent 9cc5fb3a79
commit 213a9956b6
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -18,24 +18,24 @@ export default class AssetsUser extends PureComponent<
private async searchOcean() { private async searchOcean() {
if (this.context.account) { if (this.context.account) {
this.context.ocean.keeper.didRegistry.contract.getPastEvents( this.context.ocean.keeper.didRegistry.contract.getPastEvents(
'DIDAttributeRegistered', 'DIDAttributeRegistered',
{ {
filter: { _owner: this.context.account }, filter: { _owner: this.context.account },
fromBlock: 0, fromBlock: 0,
toBlock: 'latest' toBlock: 'latest'
}, },
async (error: any, events: any) => { async (error: any, events: any) => {
if (error) { if (error) {
Logger.log('error retrieving', error) Logger.log('error retrieving', error)
this.setState({ isLoading: false }) this.setState({ isLoading: false })
} else { } else {
const results = [] const results = []
for (const event of events) { for (const event of events) {
const ddo = await this.context.ocean.assets.resolve( const ddo = await this.context.ocean.assets.resolve(
`did:op:${event.returnValues._did.substring(2)}` `did:op:${event.returnValues._did.substring(2)}`
) )
results.push(ddo) results.push(ddo)
} }
this.setState({ results, isLoading: false }) this.setState({ results, isLoading: false })
} }
@ -56,11 +56,11 @@ export default class AssetsUser extends PureComponent<
</h2> </h2>
)} )}
{this.state.isLoading ? ( {this.state.isLoading ? (
<Spinner /> <Spinner />
) : this.state.results.length ? ( ) : this.state.results.length ? (
<> <>
{this.state.results {this.state.results
.slice( .slice(
0, 0,
this.props.recent this.props.recent