diff --git a/.gitignore b/.gitignore
index 879d4ba..8e8b30c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,5 +4,6 @@ config/livenet/password
config/production/password
coverage
dist
+build
embarkArtifacts
node_modules
diff --git a/src/actions/redeem.ts b/src/actions/redeem.ts
index 50a8dc0..c44ee5a 100644
--- a/src/actions/redeem.ts
+++ b/src/actions/redeem.ts
@@ -1,5 +1,4 @@
import { RootState } from '../reducers';
-import IERC20Detailed from '../embarkArtifacts/contracts/IERC20Detailed';
import { config } from "../config";
import { Dispatch } from 'redux';
import { newBucketContract } from "./bucket";
@@ -126,7 +125,9 @@ export const redeem = (bucketAddress: string, recipientAddress: string, cleanCod
}
//FIXME: remove! hack to wait for the request screen to slide down
- await sleep(3000);
+ if (state.web3.type === Web3Type.Status) {
+ await sleep(3000);
+ }
const redeem = bucket.methods.redeem(message, sig);
// const gas = await redeem.estimateGas();
@@ -136,14 +137,12 @@ export const redeem = (bucketAddress: string, recipientAddress: string, cleanCod
}).then((resp: any) => {
dispatch(redeemDone(resp.transactionHash));
}).catch((err: any) => {
- console.error("redeem error: ", err.reason);
- console.error("redeem error reason: ", err);
- dispatch(redeemError(err.reason))
+ dispatch(redeemError(err.reason || err.message || err))
});
}).catch((err: any) => {
console.error("sign redeem error reason:", err.reason);
console.error("sign redeem error:", err);
- dispatch(redeemError(err))
+ dispatch(redeemError(err.reason || err.message || err))
});
}
}
diff --git a/src/components/Redeem.tsx b/src/components/Redeem.tsx
index 9597a4d..7f49c85 100644
--- a/src/components/Redeem.tsx
+++ b/src/components/Redeem.tsx
@@ -8,7 +8,6 @@ import {
} from 'react-redux';
import { redeemPath } from '../config';
import {
- Token,
TokenERC20,
TokenNFT,
loadRedeemable,
@@ -129,7 +128,7 @@ export default function(ownProps: any) {
{token.metadata !== undefined && <>
Name: {token.metadata.name}
Description: {token.metadata.description}
-
+
>}
>}
>
diff --git a/src/index.tsx b/src/index.tsx
index 83e2b9f..4a54c6f 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect } from 'react';
+import React from 'react';
import ReactDOM from 'react-dom';
import thunkMiddleware from 'redux-thunk';
import { Provider } from 'react-redux';