mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
adapt to new faucet server response format, pass through success message
This commit is contained in:
parent
f468b8aafb
commit
07a7b41258
@ -25,18 +25,17 @@ export default class Faucet extends PureComponent<{}, FaucetState> {
|
|||||||
try {
|
try {
|
||||||
const response = await requestFromFaucet()
|
const response = await requestFromFaucet()
|
||||||
|
|
||||||
if (response.error) {
|
if (!response.success) {
|
||||||
this.setState({
|
this.setState({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
error: response.error
|
error: response.message
|
||||||
})
|
})
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
success: 'Successfully added ETH to your account.'
|
success: response.message
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.setState({ isLoading: false, error })
|
this.setState({ isLoading: false, error })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user