mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-13 20:08:56 +00:00
fixed tx complete frozen browser
This commit is contained in:
parent
7de3667e42
commit
c77c8f0141
@ -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,
|
||||
|
@ -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 = {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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<string> = [
|
||||
ADD, OPEN, CLOSE,
|
||||
STORAGE.READY,
|
||||
SEND.TX_COMPLETE,
|
||||
"web3__create"
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user