mirror of
https://github.com/trezor/trezor-wallet
synced 2025-04-30 14:09:08 +00:00
remove unnecessary SEND.TX_COMPLETE action
This commit is contained in:
parent
215fab48eb
commit
695ae17176
@ -6,7 +6,6 @@ import * as ACCOUNT from 'actions/constants/account';
|
|||||||
import * as DISCOVERY from 'actions/constants/discovery';
|
import * as DISCOVERY from 'actions/constants/discovery';
|
||||||
import * as TOKEN from 'actions/constants/token';
|
import * as TOKEN from 'actions/constants/token';
|
||||||
import * as PENDING from 'actions/constants/pendingTx';
|
import * as PENDING from 'actions/constants/pendingTx';
|
||||||
import * as SEND from 'actions/constants/send';
|
|
||||||
|
|
||||||
import * as reducerUtils from 'reducers/utils';
|
import * as reducerUtils from 'reducers/utils';
|
||||||
|
|
||||||
@ -184,7 +183,6 @@ const getAccountNotification = (state: State, selectedAccount: SelectedAccountSt
|
|||||||
const actions = [
|
const actions = [
|
||||||
LOCATION_CHANGE,
|
LOCATION_CHANGE,
|
||||||
...Object.values(BLOCKCHAIN).filter(v => typeof v === 'string'),
|
...Object.values(BLOCKCHAIN).filter(v => typeof v === 'string'),
|
||||||
SEND.TX_COMPLETE,
|
|
||||||
WALLET.SET_SELECTED_DEVICE,
|
WALLET.SET_SELECTED_DEVICE,
|
||||||
WALLET.UPDATE_SELECTED_DEVICE,
|
WALLET.UPDATE_SELECTED_DEVICE,
|
||||||
...Object.values(ACCOUNT).filter(v => typeof v === 'string' && v !== ACCOUNT.UPDATE_SELECTED_ACCOUNT && v !== ACCOUNT.DISPOSE), // exported values got unwanted "__esModule: true" as first element
|
...Object.values(ACCOUNT).filter(v => typeof v === 'string' && v !== ACCOUNT.UPDATE_SELECTED_ACCOUNT && v !== ACCOUNT.DISPOSE), // exported values got unwanted "__esModule: true" as first element
|
||||||
|
@ -12,24 +12,10 @@ import type {
|
|||||||
} from 'flowtype';
|
} from 'flowtype';
|
||||||
import type { State as EthereumState } from 'reducers/SendFormEthereumReducer';
|
import type { State as EthereumState } from 'reducers/SendFormEthereumReducer';
|
||||||
import type { State as RippleState } from 'reducers/SendFormRippleReducer';
|
import type { State as RippleState } from 'reducers/SendFormRippleReducer';
|
||||||
import type { Account } from 'reducers/AccountsReducer';
|
|
||||||
|
|
||||||
import * as EthereumSendFormActions from './ethereum/SendFormActions';
|
import * as EthereumSendFormActions from './ethereum/SendFormActions';
|
||||||
import * as RippleSendFormActions from './ripple/SendFormActions';
|
import * as RippleSendFormActions from './ripple/SendFormActions';
|
||||||
|
|
||||||
export type SendTxAction = {
|
|
||||||
type: typeof SEND.TX_COMPLETE,
|
|
||||||
//networkType: 'ethereum',
|
|
||||||
account: Account,
|
|
||||||
selectedCurrency: string,
|
|
||||||
amount: string,
|
|
||||||
total: string,
|
|
||||||
tx: any,
|
|
||||||
nonce: number,
|
|
||||||
txid: string,
|
|
||||||
txData: any,
|
|
||||||
}
|
|
||||||
|
|
||||||
export type SendFormAction = {
|
export type SendFormAction = {
|
||||||
type: typeof SEND.INIT | typeof SEND.VALIDATION | typeof SEND.CHANGE,
|
type: typeof SEND.INIT | typeof SEND.VALIDATION | typeof SEND.CHANGE,
|
||||||
networkType: 'ethereum',
|
networkType: 'ethereum',
|
||||||
@ -40,7 +26,9 @@ export type SendFormAction = {
|
|||||||
state: RippleState,
|
state: RippleState,
|
||||||
} | {
|
} | {
|
||||||
type: typeof SEND.TOGGLE_ADVANCED | typeof SEND.TX_SENDING | typeof SEND.TX_ERROR,
|
type: typeof SEND.TOGGLE_ADVANCED | typeof SEND.TX_SENDING | typeof SEND.TX_ERROR,
|
||||||
} | SendTxAction;
|
} | {
|
||||||
|
type: typeof SEND.TX_COMPLETE,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// list of all actions which has influence on "sendForm" reducer
|
// list of all actions which has influence on "sendForm" reducer
|
||||||
|
@ -23,32 +23,12 @@ import type {
|
|||||||
TrezorDevice,
|
TrezorDevice,
|
||||||
} from 'flowtype';
|
} from 'flowtype';
|
||||||
import type { State, FeeLevel } from 'reducers/SendFormEthereumReducer';
|
import type { State, FeeLevel } from 'reducers/SendFormEthereumReducer';
|
||||||
import type { Account } from 'reducers/AccountsReducer';
|
|
||||||
import * as SessionStorageActions from '../SessionStorageActions';
|
import * as SessionStorageActions from '../SessionStorageActions';
|
||||||
import { prepareEthereumTx, serializeEthereumTx } from '../TxActions';
|
import { prepareEthereumTx, serializeEthereumTx } from '../TxActions';
|
||||||
import * as BlockchainActions from './BlockchainActions';
|
import * as BlockchainActions from './BlockchainActions';
|
||||||
|
|
||||||
import * as ValidationActions from './SendFormValidationActions';
|
import * as ValidationActions from './SendFormValidationActions';
|
||||||
|
|
||||||
export type SendTxAction = {
|
|
||||||
type: typeof SEND.TX_COMPLETE,
|
|
||||||
account: Account,
|
|
||||||
selectedCurrency: string,
|
|
||||||
amount: string,
|
|
||||||
total: string,
|
|
||||||
tx: any,
|
|
||||||
nonce: number,
|
|
||||||
txid: string,
|
|
||||||
txData: any,
|
|
||||||
};
|
|
||||||
|
|
||||||
export type sendFormEthereumAction = {
|
|
||||||
type: typeof SEND.INIT | typeof SEND.VALIDATION | typeof SEND.CHANGE,
|
|
||||||
state: State,
|
|
||||||
} | {
|
|
||||||
type: typeof SEND.TOGGLE_ADVANCED | typeof SEND.TX_SENDING | typeof SEND.TX_ERROR,
|
|
||||||
} | SendTxAction;
|
|
||||||
|
|
||||||
// list of all actions which has influence on "sendFormEthereum" reducer
|
// list of all actions which has influence on "sendFormEthereum" reducer
|
||||||
// other actions will be ignored
|
// other actions will be ignored
|
||||||
const actions = [
|
const actions = [
|
||||||
@ -542,17 +522,7 @@ export const onSend = (): AsyncAction => async (dispatch: Dispatch, getState: Ge
|
|||||||
|
|
||||||
const { txid } = push.payload;
|
const { txid } = push.payload;
|
||||||
|
|
||||||
dispatch({
|
dispatch({ type: SEND.TX_COMPLETE });
|
||||||
type: SEND.TX_COMPLETE,
|
|
||||||
account,
|
|
||||||
selectedCurrency: currentState.currency,
|
|
||||||
amount: currentState.amount,
|
|
||||||
total: currentState.total,
|
|
||||||
tx: txData,
|
|
||||||
nonce,
|
|
||||||
txid,
|
|
||||||
txData,
|
|
||||||
});
|
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: PENDING.ADD,
|
type: PENDING.ADD,
|
||||||
|
@ -19,23 +19,10 @@ import type {
|
|||||||
TrezorDevice,
|
TrezorDevice,
|
||||||
} from 'flowtype';
|
} from 'flowtype';
|
||||||
import type { State } from 'reducers/SendFormRippleReducer';
|
import type { State } from 'reducers/SendFormRippleReducer';
|
||||||
import type { Account } from 'reducers/AccountsReducer';
|
|
||||||
import * as SessionStorageActions from '../SessionStorageActions';
|
import * as SessionStorageActions from '../SessionStorageActions';
|
||||||
|
|
||||||
import * as ValidationActions from './SendFormValidationActions';
|
import * as ValidationActions from './SendFormValidationActions';
|
||||||
|
|
||||||
export type SendTxAction = {
|
|
||||||
type: typeof SEND.TX_COMPLETE,
|
|
||||||
account: Account,
|
|
||||||
selectedCurrency: string,
|
|
||||||
amount: string,
|
|
||||||
total: string,
|
|
||||||
tx: any,
|
|
||||||
nonce: number,
|
|
||||||
txid: string,
|
|
||||||
txData: any,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called from WalletService
|
* Called from WalletService
|
||||||
*/
|
*/
|
||||||
@ -251,17 +238,7 @@ export const onSend = (): AsyncAction => async (dispatch: Dispatch, getState: Ge
|
|||||||
|
|
||||||
const { txid } = push.payload;
|
const { txid } = push.payload;
|
||||||
|
|
||||||
dispatch({
|
dispatch({ type: SEND.TX_COMPLETE });
|
||||||
type: SEND.TX_COMPLETE,
|
|
||||||
account,
|
|
||||||
selectedCurrency: currentState.networkSymbol,
|
|
||||||
amount: currentState.amount,
|
|
||||||
total: currentState.total,
|
|
||||||
tx: {},
|
|
||||||
nonce: account.nonce,
|
|
||||||
txid,
|
|
||||||
txData: {},
|
|
||||||
});
|
|
||||||
|
|
||||||
// clear session storage
|
// clear session storage
|
||||||
dispatch(SessionStorageActions.clear());
|
dispatch(SessionStorageActions.clear());
|
||||||
|
@ -6,7 +6,6 @@ import * as CONNECT from 'actions/constants/TrezorConnect';
|
|||||||
import * as TOKEN from 'actions/constants/token';
|
import * as TOKEN from 'actions/constants/token';
|
||||||
import * as ACCOUNT from 'actions/constants/account';
|
import * as ACCOUNT from 'actions/constants/account';
|
||||||
import * as DISCOVERY from 'actions/constants/discovery';
|
import * as DISCOVERY from 'actions/constants/discovery';
|
||||||
import * as SEND from 'actions/constants/send';
|
|
||||||
import * as PENDING from 'actions/constants/pendingTx';
|
import * as PENDING from 'actions/constants/pendingTx';
|
||||||
import * as WALLET from 'actions/constants/wallet';
|
import * as WALLET from 'actions/constants/wallet';
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ const LocalStorageService: Middleware = (api: MiddlewareAPI) => (next: Middlewar
|
|||||||
api.dispatch(LocalStorageActions.save());
|
api.dispatch(LocalStorageActions.save());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SEND.TX_COMPLETE:
|
case PENDING.ADD:
|
||||||
case PENDING.TX_RESOLVED:
|
case PENDING.TX_RESOLVED:
|
||||||
case PENDING.TX_REJECTED:
|
case PENDING.TX_REJECTED:
|
||||||
api.dispatch(LocalStorageActions.save());
|
api.dispatch(LocalStorageActions.save());
|
||||||
|
Loading…
Reference in New Issue
Block a user