mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
message tweaks
This commit is contained in:
parent
b2ae8fcce5
commit
0e12204a5a
2170
client/package-lock.json
generated
2170
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,7 @@ export default class AssetFile extends PureComponent<
|
|||||||
> {
|
> {
|
||||||
public state = {
|
public state = {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
message: '1/3 Decrypting file URL...',
|
message: 'Decrypting file URL...',
|
||||||
error: '',
|
error: '',
|
||||||
step: null
|
step: null
|
||||||
}
|
}
|
||||||
@ -36,6 +36,7 @@ export default class AssetFile extends PureComponent<
|
|||||||
// 1 AgreementInitialized
|
// 1 AgreementInitialized
|
||||||
// 2 LockingPayment
|
// 2 LockingPayment
|
||||||
// 3 LockedPayment
|
// 3 LockedPayment
|
||||||
|
// 4 (not from squid-js) before consume function is executed
|
||||||
switch (step) {
|
switch (step) {
|
||||||
case 0:
|
case 0:
|
||||||
return '1/3<br />Asking for agreement signature...'
|
return '1/3<br />Asking for agreement signature...'
|
||||||
@ -45,6 +46,8 @@ export default class AssetFile extends PureComponent<
|
|||||||
return '2/3<br />Asking for two payment confirmations...'
|
return '2/3<br />Asking for two payment confirmations...'
|
||||||
case 3:
|
case 3:
|
||||||
return '2/3<br />Payment confirmed. Requesting access...'
|
return '2/3<br />Payment confirmed. Requesting access...'
|
||||||
|
case 4:
|
||||||
|
return '3/3<br /> Access granted. Consuming file...'
|
||||||
default:
|
default:
|
||||||
return this.state.message
|
return this.state.message
|
||||||
}
|
}
|
||||||
@ -53,7 +56,7 @@ export default class AssetFile extends PureComponent<
|
|||||||
private resetState = () =>
|
private resetState = () =>
|
||||||
this.setState({
|
this.setState({
|
||||||
isLoading: true,
|
isLoading: true,
|
||||||
message: '1/3 Decrypting file URL...',
|
message: 'Decrypting file URL...',
|
||||||
error: '',
|
error: '',
|
||||||
step: null
|
step: null
|
||||||
})
|
})
|
||||||
@ -76,10 +79,8 @@ export default class AssetFile extends PureComponent<
|
|||||||
.order(ddo.id, service.serviceDefinitionId, accounts[0])
|
.order(ddo.id, service.serviceDefinitionId, accounts[0])
|
||||||
.next((step: number) => this.setState({ step }))
|
.next((step: number) => this.setState({ step }))
|
||||||
|
|
||||||
this.setState({
|
// manually add another step here for better UX
|
||||||
step: null,
|
this.setState({ step: 4 })
|
||||||
message: '3/3<br /> Access granted. Consuming file...'
|
|
||||||
})
|
|
||||||
|
|
||||||
const path = await ocean.assets.consume(
|
const path = await ocean.assets.consume(
|
||||||
agreementId,
|
agreementId,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user