adapt to new faucet server response format, pass through success message

This commit is contained in:
Matthias Kretschmann 2019-04-11 18:39:39 +02:00
parent f468b8aafb
commit 07a7b41258
Signed by: m
GPG Key ID: 606EEEF3C479A91F
1 changed files with 3 additions and 4 deletions

View File

@ -25,18 +25,17 @@ export default class Faucet extends PureComponent<{}, FaucetState> {
try {
const response = await requestFromFaucet()
if (response.error) {
if (!response.success) {
this.setState({
isLoading: false,
error: response.error
error: response.message
})
return
}
this.setState({
isLoading: false,
success: 'Successfully added ETH to your account.'
success: response.message
})
} catch (error) {
this.setState({ isLoading: false, error })