diff --git a/src/js/actions/SendFormActions.js b/src/js/actions/SendFormActions.js index e2a25132..99572346 100644 --- a/src/js/actions/SendFormActions.js +++ b/src/js/actions/SendFormActions.js @@ -37,6 +37,11 @@ import type { Account } from '../reducers/AccountsReducer'; export type SendFormAction = { type: typeof SEND.TX_COMPLETE, + account: Account, + token: string, + amount: string, + txid: string, + txData: any, } | { type: typeof SEND.INIT, state: State @@ -832,11 +837,11 @@ export const onSend = (): AsyncAction => { try { const tx = new EthereumjsTx(txData); const serializedTx = '0x' + tx.serialize().toString('hex'); - const txid = await pushTx(web3, serializedTx); + const txid: string = await pushTx(web3, serializedTx); dispatch({ type: SEND.TX_COMPLETE, - address: account, + account: account, token: currentState.token, amount: currentState.amount, txid, diff --git a/src/js/components/wallet/send/PendingTransactions.js b/src/js/components/wallet/send/PendingTransactions.js index ef4e3057..c0386fea 100644 --- a/src/js/components/wallet/send/PendingTransactions.js +++ b/src/js/components/wallet/send/PendingTransactions.js @@ -17,6 +17,7 @@ type Props = ParentProps & { const PendingTransactions = (props: Props) => { + const account = props.account; //props.accounts.find(a => a.deviceState === props.sendForm.deviceState && a.index === props.sendForm.accountIndex && a.network === props.sendForm.network); const pending = props.pending.filter(p => p.network === account.network && p.address === account.address); @@ -31,7 +32,7 @@ const PendingTransactions = (props: Props) => { let iconColor, symbol, name; - if (tx.token !== tx.network) { + if (tx.token !== props.selectedCoin.symbol) { const token = tokens.find(t => t.symbol === tx.token); if (token) { iconColor = { @@ -41,6 +42,14 @@ const PendingTransactions = (props: Props) => { } symbol = token.symbol.toUpperCase(); name = token.name; + } else { + iconColor = { + color: '#ffffff', + background: '#000000', + borderColor: '#000000' + } + symbol = "Unknown"; + name = "Unknown"; } } else { iconColor = { diff --git a/src/js/reducers/PendingTxReducer.js b/src/js/reducers/PendingTxReducer.js index 7dd0fb85..8fa55f5e 100644 --- a/src/js/reducers/PendingTxReducer.js +++ b/src/js/reducers/PendingTxReducer.js @@ -23,10 +23,10 @@ const add = (state: State, action: any) => { const newState = [ ...state ]; newState.push({ id: action.txid, - network: action.address.network, + network: action.account.network, + address: action.account.address, token: action.token, amount: action.amount, - address: action.address.address, }); return newState; } diff --git a/src/js/services/LogService.js b/src/js/services/LogService.js index cc8ebf5a..f2c19899 100644 --- a/src/js/services/LogService.js +++ b/src/js/services/LogService.js @@ -3,6 +3,7 @@ import * as LogActions from '../actions/LogActions'; import * as STORAGE from '../actions/constants/localStorage'; +import * as SEND from '../actions/constants/send'; import { OPEN, CLOSE, ADD } from '../actions/constants/log'; import type { @@ -19,6 +20,7 @@ import type { const exclude: Array = [ ADD, OPEN, CLOSE, STORAGE.READY, + SEND.TX_COMPLETE, "web3__create" ];