1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00

fixed tx complete frozen browser

This commit is contained in:
Szymon Lesisz 2018-05-09 17:47:34 +02:00
parent 7de3667e42
commit c77c8f0141
4 changed files with 21 additions and 5 deletions

View File

@ -37,6 +37,11 @@ import type { Account } from '../reducers/AccountsReducer';
export type SendFormAction = { export type SendFormAction = {
type: typeof SEND.TX_COMPLETE, type: typeof SEND.TX_COMPLETE,
account: Account,
token: string,
amount: string,
txid: string,
txData: any,
} | { } | {
type: typeof SEND.INIT, type: typeof SEND.INIT,
state: State state: State
@ -832,11 +837,11 @@ export const onSend = (): AsyncAction => {
try { try {
const tx = new EthereumjsTx(txData); const tx = new EthereumjsTx(txData);
const serializedTx = '0x' + tx.serialize().toString('hex'); const serializedTx = '0x' + tx.serialize().toString('hex');
const txid = await pushTx(web3, serializedTx); const txid: string = await pushTx(web3, serializedTx);
dispatch({ dispatch({
type: SEND.TX_COMPLETE, type: SEND.TX_COMPLETE,
address: account, account: account,
token: currentState.token, token: currentState.token,
amount: currentState.amount, amount: currentState.amount,
txid, txid,

View File

@ -17,6 +17,7 @@ type Props = ParentProps & {
const PendingTransactions = (props: Props) => { 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 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); 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; let iconColor, symbol, name;
if (tx.token !== tx.network) { if (tx.token !== props.selectedCoin.symbol) {
const token = tokens.find(t => t.symbol === tx.token); const token = tokens.find(t => t.symbol === tx.token);
if (token) { if (token) {
iconColor = { iconColor = {
@ -41,6 +42,14 @@ const PendingTransactions = (props: Props) => {
} }
symbol = token.symbol.toUpperCase(); symbol = token.symbol.toUpperCase();
name = token.name; name = token.name;
} else {
iconColor = {
color: '#ffffff',
background: '#000000',
borderColor: '#000000'
}
symbol = "Unknown";
name = "Unknown";
} }
} else { } else {
iconColor = { iconColor = {

View File

@ -23,10 +23,10 @@ const add = (state: State, action: any) => {
const newState = [ ...state ]; const newState = [ ...state ];
newState.push({ newState.push({
id: action.txid, id: action.txid,
network: action.address.network, network: action.account.network,
address: action.account.address,
token: action.token, token: action.token,
amount: action.amount, amount: action.amount,
address: action.address.address,
}); });
return newState; return newState;
} }

View File

@ -3,6 +3,7 @@
import * as LogActions from '../actions/LogActions'; import * as LogActions from '../actions/LogActions';
import * as STORAGE from '../actions/constants/localStorage'; import * as STORAGE from '../actions/constants/localStorage';
import * as SEND from '../actions/constants/send';
import { OPEN, CLOSE, ADD } from '../actions/constants/log'; import { OPEN, CLOSE, ADD } from '../actions/constants/log';
import type { import type {
@ -19,6 +20,7 @@ import type {
const exclude: Array<string> = [ const exclude: Array<string> = [
ADD, OPEN, CLOSE, ADD, OPEN, CLOSE,
STORAGE.READY, STORAGE.READY,
SEND.TX_COMPLETE,
"web3__create" "web3__create"
]; ];