mirror of
https://github.com/status-im/keycard-redeem.git
synced 2025-01-12 21:24:32 +00:00
fix web3/config error
This commit is contained in:
parent
5c51dcc1d8
commit
3fbbffca65
@ -84,7 +84,7 @@ export const initializeWeb3 = () => {
|
||||
}
|
||||
|
||||
dispatch(web3NetworkIDLoaded(id))
|
||||
dispatch(loadAddress());
|
||||
dispatch<any>(loadAddress());
|
||||
});
|
||||
})
|
||||
.catch((err: string) => {
|
||||
@ -96,7 +96,7 @@ export const initializeWeb3 = () => {
|
||||
dispatch(web3Initialized(t));
|
||||
config.web3!.eth.net.getId().then((id: number) => {
|
||||
dispatch(web3NetworkIDLoaded(id))
|
||||
dispatch(loadAddress());
|
||||
dispatch<any>(loadAddress());
|
||||
})
|
||||
.catch((err: string) => {
|
||||
//FIXME: handle error
|
||||
@ -110,7 +110,7 @@ export const initializeWeb3 = () => {
|
||||
|
||||
const loadAddress = () => {
|
||||
return (dispatch: Dispatch, getState: () => RootState) => {
|
||||
web3.eth.getAccounts().then((accounts: string[]) => {
|
||||
config.web3!.eth.getAccounts().then((accounts: string[]) => {
|
||||
dispatch(accountLoaded(accounts[0]));
|
||||
});
|
||||
};
|
||||
|
@ -1,7 +1,11 @@
|
||||
import Web3 from "web3";
|
||||
|
||||
export const config = {
|
||||
export interface Config {
|
||||
web3: Web3 | undefined
|
||||
}
|
||||
|
||||
export const config: Config = {
|
||||
web3: undefined
|
||||
};
|
||||
|
||||
export const redeemPath = "/redeem/:bucketAddress/:recipientAddress";
|
||||
|
Loading…
x
Reference in New Issue
Block a user