fix web3/config error
This commit is contained in:
parent
5c51dcc1d8
commit
3fbbffca65
|
@ -84,7 +84,7 @@ export const initializeWeb3 = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch(web3NetworkIDLoaded(id))
|
dispatch(web3NetworkIDLoaded(id))
|
||||||
dispatch(loadAddress());
|
dispatch<any>(loadAddress());
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((err: string) => {
|
.catch((err: string) => {
|
||||||
|
@ -96,7 +96,7 @@ export const initializeWeb3 = () => {
|
||||||
dispatch(web3Initialized(t));
|
dispatch(web3Initialized(t));
|
||||||
config.web3!.eth.net.getId().then((id: number) => {
|
config.web3!.eth.net.getId().then((id: number) => {
|
||||||
dispatch(web3NetworkIDLoaded(id))
|
dispatch(web3NetworkIDLoaded(id))
|
||||||
dispatch(loadAddress());
|
dispatch<any>(loadAddress());
|
||||||
})
|
})
|
||||||
.catch((err: string) => {
|
.catch((err: string) => {
|
||||||
//FIXME: handle error
|
//FIXME: handle error
|
||||||
|
@ -110,7 +110,7 @@ export const initializeWeb3 = () => {
|
||||||
|
|
||||||
const loadAddress = () => {
|
const loadAddress = () => {
|
||||||
return (dispatch: Dispatch, getState: () => RootState) => {
|
return (dispatch: Dispatch, getState: () => RootState) => {
|
||||||
web3.eth.getAccounts().then((accounts: string[]) => {
|
config.web3!.eth.getAccounts().then((accounts: string[]) => {
|
||||||
dispatch(accountLoaded(accounts[0]));
|
dispatch(accountLoaded(accounts[0]));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
import Web3 from "web3";
|
import Web3 from "web3";
|
||||||
|
|
||||||
export const config = {
|
export interface Config {
|
||||||
web3: Web3 | undefined
|
web3: Web3 | undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
export const config: Config = {
|
||||||
|
web3: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
export const redeemPath = "/redeem/:bucketAddress/:recipientAddress";
|
export const redeemPath = "/redeem/:bucketAddress/:recipientAddress";
|
||||||
|
|
Loading…
Reference in New Issue