Commit 4dbade52 authored by Chi Kei Chan's avatar Chi Kei Chan Committed by GitHub

Add Documentation; Remove Pending Tx on reject (#114)

parent 058cfc26
......@@ -5,3 +5,24 @@ This is the repository for [uniswap.io](https://uniswap.io/). Uniswap is an inte
* Join the reddit: [https://www.reddit.com/r/Uniswap/](https://www.reddit.com/r/UniSwap/)
* Email us: [contact@uniswap.io](mailto:contact@uniswap.io)
* Read the whitepaper: [Link](https://hackmd.io/C-DvwDSfSxuh-Gd4WKE_ig)
### To Start Development
###### Installing dependency
```bash
yarn
```
###### Running locally on Rinkeby
```bash
yarn start:rinkeby
```
###### Running locally on other testnet
```bash
REACT_APP_NETWORK_ID=2 REACT_APP_NETWORK='Ropsten Test Network' react-scripts start
```
### Contributions
Please open all pull requests against `dev` branch.
......@@ -342,18 +342,30 @@ export const sync = () => async (dispatch, getState) => {
});
pending.forEach(async txId => {
const data = await web3.eth.getTransactionReceipt(txId) || {};
if (data.status) {
try {
const data = await web3.eth.getTransactionReceipt(txId) || {};
dispatch({
type: REMOVE_PENDING_TX,
payload: txId,
});
if (data.status) {
dispatch({
type: ADD_CONFIRMED_TX,
payload: txId,
});
} else {
// TODO: dispatch ADD_REJECTED_TX
}
} catch (err) {
dispatch({
type: ADD_CONFIRMED_TX,
type: REMOVE_PENDING_TX,
payload: txId,
});
// TODO: dispatch ADD_REJECTED_TX
}
});
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment